Amazon Great Offers

July 18, 2012

Text Formatting in *NIX to run Script files of Different Platforms

Hello all,

While writing shell scripting in Ubuntu, Windows and deploying it in *NIX based machine, we found some issue. That the file running perfectly on the Ubuntu (Linux), Windows machine. The same script was displaying errors like

'\r': command not found
^M: command not found
 
There was a formatting issue. You need to run the following command to resolve it.

DOS2UNIX

Installation:
sudo apt-get install tofrodos

Syntax: 
dos2unix filename

Example:
dos2unix script1.sh

To know more about this you can go through References.

References:
http://linuxcommand.org/man_pages/dos2unix1.html
http://www.thefreecountry.com/tofrodos/

If you have any further queries, please add your comments. You can also mail to psrdotcom@gmail.com
Post a Comment

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com