Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site masscomp.UUCP Path: utzoo!watmath!clyde!bonnie!masscomp!leiby From: leiby@masscomp.UUCP (Mike Leibensperger) Newsgroups: net.unix Subject: Re: "set" question for Bourne shell scripts Message-ID: <617@masscomp.UUCP> Date: Thu, 14-Feb-85 14:16:14 EST Article-I.D.: masscomp.617 Posted: Thu Feb 14 14:16:14 1985 Date-Received: Fri, 15-Feb-85 04:21:42 EST References: <661@turtlevax.UUCP> Reply-To: leiby@masscomp.UUCP (Mike Leibensperger) Distribution: net Organization: Masscomp - Westford, MA Lines: 25 Summary: In article <661@turtlevax.UUCP> ken@turtlevax.UUCP (Ken Turkowski) writes: >The Bourne shell allows you to set the positional parameters with: > set a b c d e >so that > $1 yields a > $2 yields b > $3 yields c > $4 yields d > $5 yields e > $# yields 5 >regardless of the parameters given to the shell script on the command line. >Now, my question is, how do you remove all parameters, i.e. set $# to 0? The following works, tho it probably isn't the fastest: : while [ $# != 0 ] do echo my $# args are: $* shift done -- Mike Leibensperger Masscomp; 1 Technology Park; Westford, MA 01886 {decvax,harpo,tektronix}!masscomp!leiby