Path: utzoo!mnetor!uunet!husc6!sri-unix!quintus!sun!decwrl!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.unix.questions Subject: Re: Shell parameter bugs? Message-ID: <2450003@hpsal2.HP.COM> Date: 18 Mar 88 19:39:20 GMT References: <128@richp1.UUCP> Organization: HP System Architecture Lab, Cupertino Lines: 32 / hpsal2:comp.unix.questions / kk@richp1.UUCP (Ken Konecki) / 9:01 am Mar 15, 1988 / I've found an interesting problem with the korn and bourne shells when it comes to dealing with command line parameters. When this script: echo "Number of parameters: ${#}" for arg in $* do echo "Argument is $arg" done with the line script '1 2 3' 4 5 6 the shell(s) output this: Number of parameters: 4 Argument is 1 Argument is 2 Argument is 3 Argument is 4 Argument is 5 Argument is 6 ------ The second line of your script should be: for arg in "$@" Otherwise, the shell is reexpanding the arguments, stripping off the quotes.