Karim Mtl Karim Mtl - 7 months ago 20
Bash Question

Linux shell single quotes and double quotes in one command

I need your help to make this command work:

ssh -t user@localhost "cd /tmp ; PROMPT_COMMAND='echo -ne "\033]0;log\007"' ; bash"


Here is the error that I get:

bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
Connection to localhost closed.
log007' ; bash: command not found


Thanks

Answer

I suggest to escape double quotes with backslash (\"):

ssh -t user@localhost "cd /tmp ; PROMPT_COMMAND='echo -ne \"\033]0;log\007\"' ; bash"
Comments