command line options
Root Boy Jim
rbj at icst-cmr.arpa
Mon Apr 11 12:37:23 AEST 1988
From: Arthur David Olson <ado at elsie.uucp>
3. I want to be able to find out if "--" was used on the command line.
Pike's Position is that
Programs that accept multiple filenames
should do nothing if given no arguments.
(The name and wording are mine; see page 186 of "The UNIX Programming
Environment"). This ensures that if you use a command such as
cat `find * -type f -print`
to concatenate all the files in a directory and its subdirectories,
you won't get surprised when there are NO files in the directory and
cat starts reading from its standard input.
Add /dev/null to the end. This trick is also used in the GNU emacs `grep'
command. They add /dev/null to the end so that grep will tell which file
it was found in, even if there was only one specified.
(Root Boy) Jim Cottrell <rbj at icst-cmr.arpa>
National Bureau of Standards
Flamer's Hotline: (301) 975-5688
There's enough money here to buy 5000 cans of Noodle-Roni!
More information about the Comp.unix.wizards
mailing list