Hi all,
some small script with eval turned me to crazy.
my OS is linux
Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux
below script works well
#!/bin/bash
eval ssh remotehost date
eval ssh remotehost ls
below script works also well
echo "ls
ls -l" | while read line;do
eval $line
done
then below script has issue that only first line of command got executed
echo "ssh remotehost date
ssh remotehost ls" | while read line;do
eval $line
done
i was thinking maybe eval break the loop, but below script do print out the "-----" line
echo "ssh remotehost date
ssh remotehost ls" | while read line;do
eval $line
echo "----"
done
so what wrong here, please kindly help.