Enclosing a command in escape characters in bash -
i have command in quotes:
ssh -i "/home/$user/$key" "$user"@"$worker1ip" "echo 'if [[ `uname -a` == darwin* ]]; then' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
the "uname" part has written literally, not executed. tried using "\" before 'uname' part, don't know how close it. can please?
this should work:
ssh -i "/home/$user/$key" "$user"@"$worker1ip" "echo 'if [[ \"\$(uname -a)\" == darwin* ]]; then' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
and too:
ssh -i "/home/$user/$key" "$user"@"$worker1ip" "echo 'if [[ \`uname -a\` == darwin* ]]; then' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
Comments
Post a Comment