Converting files from DOS format to Unix

A useful perl one liner is

perl -p -i -e 's/\r\n/\n/' *.pl

Of course you can always do the reverse,

perl -p -i -e 's/\n/\r\n/' *.pl

Advertisements

One thought on “Converting files from DOS format to Unix

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s