Xref: utzoo comp.unix.wizards:19549 comp.unix.questions:18079 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Question about GETOPT(3) Message-ID: <1989Nov29.114601.8500@gdt.bath.ac.uk> Date: 29 Nov 89 11:46:01 GMT References: <7043@ficc.uu.net> <110@amix.commodore.com> <7077@ficc.uu.net> <118@amix.commodore.com> <7118@ficc.uu.net> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 14 In article <7118@ficc.uu.net> peter@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@bristol.ac.uk :-) (..!uunet!ukc!gdr.bath.ac.uk!exspes if you HAVE to)