-2

I have a problem using nano in a server throught ssh from mac or other linux. If I write 'sleep 10' in the terminal, over ssh, it works. if I do 'echo "sleep 10" > test.sh' and sh test.sh, it works. If I open nano, write 'sleep 10' and save as test.sh and do 'sh test.sh' doesnt works saying that 10\r invalid time interval.

Any ideas?

thx an advance

1 Answers1

0

It smells like the file you are editing already had \r (which is also known as CR or ^M) at the ends of some of it's lines

sed -i 's/\r$//' test.sh

will cure that.

Jasen
  • 11,837
  • 2
  • 30
  • 48