#!/bin/sh while true ; do echo "WTF" done
This gives a syntax error: syntax error: unexpected end of file (waiting to be done)
I also tried:
#!/bin/sh while : do echo "WTF" done
I suspect line endings.
Try:
hexdump -C yourscript.sh
Look for the sequences 0d 0a . You can make \r ( 0d ) the tr command:
0d 0a
\r
0d
tr
cat yourscript.sh | tr -d '\r' >> yournewscript.sh
#!/bin/sh while [ true ] do echo "WTF" done
Pay particular attention to spaces in the string 'while [true]'