jeudi 26 septembre 2019

Syntax error: EOF in backquote substitution in shell script

I am writing script to identify the package status as soon as package installation done. For this i am executing script from Jumpbox.

I have tried this is as single piece of code on remote machine it worked without throwing any errors. But when i try from remote node i am having this.

ssh -oStrictHostKeyChecking=no ubuntu@IP -n "ls /opt/bid/ | grep -i aggregationservices" > package
variable=`awk '{print $2}' package
ssh -oStrictHostKeyChecking=no ubuntu@10.0.1.188 -n "sudo ls /opt/bid/ > /tmp/files; input=/tmp/files;while read -r line; do for i in $line; do if [ "$variable" = "$line" ]; then sudo ls /opt/bid/$line/upstart > /tmp/test;fi;done;done < "$input""

Final output should give the package status, now i broke the code into 2 parts. In this part package names are present upstart folder i am redirecting this to the different file.

Aucun commentaire:

Enregistrer un commentaire