3 ms·
Also in some cases both -options and +options exist, where +options do the inverse of -options (e.g. dash; I think the old Perl 6 also did the same thing for su
by lifthrasiir 5y ago
Also in some cases both -options and +options exist, where +options do the inverse of -options (e.g. dash; I think the old Perl 6 also did the same thing for sub MAIN, though it's now -/options) or a subtle but useful variation of -options (e.g. ImageMagick).
- nsajko 5y agoDash just implements the behavior specified by POSIX/SUS.
- lifthrasiir 5y agoIn hindsight, indeed! They just go straight into `set`.
- eesmith 5y agoOr "tail", where "tail -12" is the last 12 lines and "tail +12" is everything after the first 12 lines.
- MontyCarloHall 5y agoThe worst offender in this regard is bash’s `set` command. For example, `set -e` enables the `e` option (exit script immediately upon seeing a nonzero exit code). Guess how to disable it? Yup, `set +e`