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

1 Comment »

  1. [...] is using the loop –n does, similar to the trick I’ve used with –p, it’s just that the –n doesn’t print automatically.  Instead I [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment