using mandriva 2007.1.
having trouble using variables in a bash script that i'm
trying to use to call a remote bash script. how do i get
this to work so i can shorten the script by using variables
in these calls?
where:
PLZ=0
BOX=1 to 6 in a loop
IPADD=6 ip addresses held in if/elif conditions,
this doesn't work:
Code:
ssh "processing-"$PLZ$BOX"@"$IPADD" nohup /home/processing-"$PLZ$BOX"/Documents/Scripts/d2u_and_nconvert.sh "&
but if i explicitly call each box, without the variables,
everything works fine:
Code:
if [ $BOX -eq 1 ]
then
ssh processing-01@192.168.1.122 nohup /home/processing-01/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 2 ]
then
ssh processing-02@192.168.1.124 nohup /home/processing-02/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 3 ]
then
ssh processing-03@192.168.1.126 nohup /home/processing-03/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 4 ]
then
ssh processing-04@192.168.1.128 nohup /home/processing-04/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 5 ]
then
ssh processing-05@192.168.1.130 nohup /home/processing-05/Documents/Scripts/d2u_and_nconvert.sh &
else [ $BOX -eq 6 ]
ssh processing-06@192.168.1.132 nohup /home/processing-06/Documents/Scripts/d2u_and_nconvert.sh &
fi
also tried this (excludes nohup in the call), which also works:
Code:
if [ $BOX -eq 1 ]
then
ssh processing-01@192.168.1.122 /home/processing-01/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 2 ]
then
ssh processing-02@192.168.1.124 /home/processing-02/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 3 ]
then
ssh processing-03@192.168.1.126 /home/processing-03/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 4 ]
then
ssh processing-04@192.168.1.128 /home/processing-04/Documents/Scripts/d2u_and_nconvert.sh &
elif [ $BOX -eq 5 ]
then
ssh processing-05@192.168.1.130 /home/processing-05/Documents/Scripts/d2u_and_nconvert.sh &
else [ $BOX -eq 6 ]
ssh processing-06@192.168.1.132 /home/processing-06/Documents/Scripts/d2u_and_nconvert.sh &
fi
thanks,
BabaG