#34 Emulating GNU-Style Flags with Quota

The inconsistency between the command flags of various Unix systems is a perpetual problem and causes lots of grief for users who switch between any of the major releases, particularly between a commercial Unix (Solaris, HP-UX, and so on) and an open source Linux system. One command that demonstrates this problem is quota, which supports full-word flags on some Unix systems, while on others it accepts only one-letter flags.

A succinct shell script solves the problem, however, by mapping any full-word flags specified into the equivalent single-letter alternatives:

 #!/bin/sh # newquota - A front end to quota that works with full-word flags a la GNU. # quota has three possible flags, -g, -v, and -q, but ...

Get Wicked Cool Shell Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.