What to do about extraneous arguments?

John B. Chambers jbc at mcc-db.UUCP
Mon Jul 15 09:56:42 AEST 1985


From: John Chambers (guest moderator) <ut-sally!std-unix>

Topic: command line arguments continued

----------------------------------------------------------------------

From: ihnp4!tektronix!uucp at ut-sally.ARPA
Date: Saturday, 13 Jul 85 18:43:47 PDT
Subject: What to do about extraneous arguments?

Another aspect of command arguments is: after all the necessary arguments
have been processed, what if some are left?

Some commands process the whole list, and are intended to do so (e.g.
ls(1)).  Others (e.g. diff(1), cmp(1)) only work on a specific number
of arguments.

Common practice seems to be to ignore extraneous arguments.  A user here
has requested that cmp(1) be modified to generate a diagnostic if more
than 2 filenames are provided.  This might be helpful when using wildcards
for filenames, as in:

	cmp foo* fum*

If there is more than one file matching 'foo*' and you don't realize it,
the results are not what you expect.  Comments?

tektronix!rdoty


----------------------------------------------------------------------

-- 

John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
{ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc at ut-sally.ARPA, chambers at mcc.ARPA



More information about the Mod.std.unix mailing list