I have written an Expect script to go out and run a command on another host which works great. From the command line I call it by
./myExpect <hostname> <myuid> <mypass> <command>
<command> has to be in double quotes if it is more than one word i.e. "touch junk" for Expect to work
The problem is I am writting a ksh script to call myExpect so I can loop the hostname to run a command on many servers.
The script looks like this pior to me adding the while loop:
#!/usr/bin/ksh
hostid=$1
userid=$2
passwd=$3
command=$4
./myExpect $hostid $userid $passwd $command
and is called by
./myScript <hostname> <myuid> <mypass> <command>
where <command> is in double quotes i.e. "touch junk"
When myScript passes $command to myExpect it only passes the first command. So instead on passing "touch junk" it only passes "touch."
Do you guys know what can fix this? Many thanks........
./myExpect <hostname> <myuid> <mypass> <command>
<command> has to be in double quotes if it is more than one word i.e. "touch junk" for Expect to work
The problem is I am writting a ksh script to call myExpect so I can loop the hostname to run a command on many servers.
The script looks like this pior to me adding the while loop:
#!/usr/bin/ksh
hostid=$1
userid=$2
passwd=$3
command=$4
./myExpect $hostid $userid $passwd $command
and is called by
./myScript <hostname> <myuid> <mypass> <command>
where <command> is in double quotes i.e. "touch junk"
When myScript passes $command to myExpect it only passes the first command. So instead on passing "touch junk" it only passes "touch."
Do you guys know what can fix this? Many thanks........