#!/bin/sh while true ; do echo \"WTF\" done
This is giving a syntax error: syntax error: unexpected end of file (expecting \"do\")
I also tried
I suspect line endings.
Try:
hexdump -C yourscript.sh
And look for 0d 0a sequences. You can strip \r (0d) with the tr command:
0d 0a
\r
0d
tr
cat yourscript.sh | tr -d '\r' >> yournewscript.sh