Question about GETOPT(3)

P E Smee exspes at gdr.bath.ac.uk
Wed Nov 29 22:46:01 AEST 1989


In article <7118 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>And it'd remain so. You might have problems if you have a program called
>'1', '2', and so on. That's pretty unlikely.

Actually, Brian Kernighan and Rob Pike suggest such a program (shell
script) in 'The Unix Programming Environment'.  Basically, it invokes
print with an argument of -$0 -- that is, if invoked as '2' it filters
its stdin into 2 columns, if invoked as '3' into 3 columns, ...  To
'implement' a new number of columns you just add another link to the
script.  Doesn't half pollute your ~/lib namespace ...

-- 
 Paul Smee, Univ. of Bristol Comp. Centre, Bristol BS8 1TW (Tel +44 272 303132)
 Smee at bristol.ac.uk   :-)   (..!uunet!ukc!gdr.bath.ac.uk!exspes if you HAVE to)



More information about the Comp.unix.questions mailing list