This question already has an answer here:
There may be a question out there for this somewhere. But I wasn't able to find it easily.
Basically I want to write a bash script on a new box. A script that I've previously used.
#!/bin/bash -ex hi='hello world!' echo $hi
I've always used (for multiline output)
cat > script.sh <<EOF #!/bin/bash -ex hi='hello world!' echo $hi EOF
But as you may have noticed this has issues with $hi, and other symbols. Is there a good way to do this? Tips Tricks?