Download ${Unix_Tools} - The Computer Laboratory

Transcript
Command-line argument conventions (cont’d)
The special option “--” signals in many tools that subsequent words are
arguments, not options. This provides one way to access filenames
starting with a hyphen:
$ rm -- -i
$ rm ./-i
The special filename “-” signals often that standard input/output should
be used instead of a file.
All these are conventions that most – but not all – tools implement
(usually via the getopt library function), so check the respective manual
first.
The shell remains ignorant of these “-” conventions!
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
21
Shell command-line preprocessing
A number of punctuation characters in a command line are part of the
shell control syntax
| & ; ( ) < >
or can trigger special convenience substitutions before argv is handed
over to the called program:
I brace expansion: {,}
I
tilde expansion: ~
I
parameter expansion: $
I
pathname expansion / filename matching: * ? []
I
quote removal: \ ' "
22