I was writing a script in vim, dropped my keyboard, and continued coding.
I didn't notice that my cursor changed from the normal _ type cursor, to a [] block. (as if i hit insert in a windows terminal)
I started up my script, and got a /bin/bash^M: bad interpreter error.
With plenty of googling, ^M is the dos carriage return.. but when I hit enter in terminal it looks like a normal carriage return. But bash interprets it as ^M.
I practically keyboard slammed to see what on earth I hit to change this. can someone help me out here?
|
| |||
|
feedback
|
|
When you dropped your keyboard, not only did it hit the Insert key, but it managed to enter the | |||
|
feedback
|
|
To convert a file with CRLF line terminators to LF, run:
If it's an issue in vim (and not your terminal), look at gVim showing carriage return (^M) even when file mode is explicitly DOS | ||||
feedback
|
cat > testcrlf && hexdump testcrlf. When this line is executed in the terminal, press Enter followed by Ctrl + D. You should see just0ain the right column, not0a0d. – Lekensteyn Jun 6 '11 at 8:38