Escaping Variable in Cat
Posted
by
Peter
on Super User
See other posts from Super User
or by Peter
Published on 2012-11-02T04:58:11Z
Indexed on
2012/11/02
5:10 UTC
Read the original article
Hit count: 564
I'm trying to write a shell script over ssh via a bash prompt. The shell, however, insists on interpreting any variable I want to write instead of writing it directly to file. For example, cat <<EOF >checkup.sh\n'$command'EOF
is simply written as ''
to file. How do I get $command
written instead? I've tried every practical method of escaping I can think of.
If it changes anything, I'm doing it over PHP using phpseclib.
© Super User or respective owner