-
Notifications
You must be signed in to change notification settings - Fork 7
Option clustering
h908714124 edited this page Aug 27, 2021
·
16 revisions
Assume that mode flags (aka nullary options) -x and -z are defined, as well as a unary option -f.
Then the following is valid input:
tar -xzf file.tgzwhich is shorter than having to type out each option name in full:
tar -x -z -f file.tgzThe "attached" style of passing the argument of option -f also works:
tar -xzffile.tgzbut please note that for short (aka unix-style) options, = is not part of the syntax.
For example, the following would pass the file name =file.tgz, which is probably not intended.
tar -xzf=file.tgz # '=file.tgz'Of course, when a gnu-style name like --file is used instead of -f, = is valid
syntax to separate the value from the option name:
tar -xz --file=file.tgz # 'file.tgz'