You can't nest single quotes in bash, so the line is
interpreted as
/bin/bash -l -c 'echo
"'John'"'
|......| ---------- single quoted
|....| ----- not
quoted
|.| ---
quoted
So, properly escape the
single quotes:
/bin/bash -c 'echo
"'\''John'\''"'
or, if the string
in single quotes is really simple,
/bin/bash
-c 'echo "'\'John\''"'
No comments:
Post a Comment