I had a tiny bash script that is supposed to move to my home directory, make a file, echo some junk onto it, and make it executable. This is what it looked like:
cd ; touch tor.sh; echo "#!/bin/bash\n/usr/local/bin/tor" >> tor.sh; chmod +x tor.sh
But this kept breaking at the echo, complaining about "event not found" ? For some reason I decided to try this and it worked:
cd ; touch tor.sh; echo -e "\x23\x21/bin/bash\n/usr/local/bin/tor" >> tor.sh; chmod +x tor.sh
Why did I have to replace those two characters (the shebang?) with hex and a -e? Is there a better way to do this?