scripting problem

David daz at damnetwork.net
Fri Feb 16 14:34:30 MST 2007


On Fri, 16 Feb 2007, Eric \Shubes\ wrote:

> Here's a good Friday afternoon exercise for you script animals out there.
> For example,
> $ arglist="parm1 \"this is parm2\" parm3"
> $ command $arglist
>
> command receives:
> $?=5 $1=parm1, $2="this, $3=is $4=parm2" $5=parm3
>
> What I want command to receive is:
> $?=3 $1=parm1, $2=this is parm2, $3=parm3

Not sure if its the same, but the below worked.

---------------
#!/bin/sh

ls "${1}"
ls "${2}"
ls "${3}"
-------------------

Invoked as:
scriptname.sh "this is" a param

resulted in:

ls: this is: No such file or directory
ls: a: No such file or directory
ls: param: No such file or directory


David
-- 
"I find your lack of faith disturbing."
--Darth Vader
---
  14:32:01 up 10 days,  6:16,  2 users,  load average: 0.00, 0.00, 0.00


More information about the PLUG-discuss mailing list