When I get those after editing files from Windows, I run the following in vi :
:%s/.$//g
Problem is, there is never one of those ^M on the last line, so that char gets whacked.
I don't know what the above will do if they are not visible.
17 Replies - 6839 Views - Last Post: 27 December 2012 - 12:32 PM
#16
Re: Shell script will not run, permission denied
Posted 27 December 2012 - 12:05 PM
#17
Re: Shell script will not run, permission denied
Posted 27 December 2012 - 12:21 PM
To make the ^Ms visible in vim, you can use :e ++ff=unix. Then you can delete them like regular characters.
There's also a command line tool called dos2unix, which removes carriage returns from files automatically.
There's also a command line tool called dos2unix, which removes carriage returns from files automatically.
#18
Re: Shell script will not run, permission denied
Posted 27 December 2012 - 12:32 PM
Very helpful guys. Thanks for the help, and the patience as I am no UNIX guru.

New Topic/Question



MultiQuote


|