![]() |
ssh - using variables in call to start remote script from local script
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 "& everything works fine: Code:
if [ $BOX -eq 1 ] Code:
if [ $BOX -eq 1 ] BabaG |
Quote:
Code:
ssh processing-$PLZ$BOX@$IPADD "nohup /home/processing-$PLZ$BOX/Documents/Scripts/d2u_and_nconvert.sh" |
thanks for the reply, colucix.
meant that the remote script never started when i said my command didn't work. actually just finished testing another solution i found elsewhere online and it worked well. here's the link: http://systemsboy.blogspot.com/2006/...n-scripts.html that solution suggested that the entire command needed to be wrapped into a line of text as a variable and then executed: Code:
sshcmd="ssh processing-"$PLZ$BOX"@"$IPADD" nohup /home/processing-"$PLZ$BOX"/Documents/Scripts/d2u_and_nconvert.sh " BabaG |
All times are GMT -5. The time now is 06:39 PM. |