Australia/Sydney
BlogApril 28, 2012

set fileformat=unix

Fahd Mirza
Short, sweet and very useful.

Was running a shell script in Linux to execute some SQL, and got the following error during start of script:

^M: bad interpreter
 
Yes, received the script from the windows.
 
Now to rectify this, open the script file in VI editor and give following command:
 
:set fileformat=unix
 
save it with :wq
 
and run it again.
 
Should Run like a beaut. 
Share this post:
On this page

Let's Partner

If you are looking to build, deploy or scale AI solutions — whether you're just starting or facing production-scale challenges — let's chat.

Subscribe to Fahd's Newsletter

Weekly updates on AI, cloud engineering, and tech innovations