Escape characters in bash -
i have line in script here:
"echo 'conf_dir="$( cd "$( dirname "${bash_source[0]}" )" && pwd )"' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
the portion conf_dir="$( cd "$( dirname "${bash_source[0]}" )" && pwd )" has written onto tachyon-env.sh file. have tried many combinations of escape characters, either "cd" , "pwd" commands getting executed, or there syntax error. know how might print line literally onto file? in advance
the full line:
ssh -i "/home/$user/$key" "$user"@"$worker1ip" "echo 'conf_dir="$( cd "$( dirname "${bash_source[0]}" )" && pwd )"' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
this should work:
'echo "conf_dir=\"\$( cd \"\$( dirname \"\${bash_source[0]}\" )\" && pwd )\"" >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh'
this too:
"echo 'conf_dir=\"\$( cd \"\$( dirname \"\${bash_source[0]}\" )\" && pwd )\"' >> /home/$user/tachyon-0.5.0/conf/tachyon-env.sh"
Comments
Post a Comment