Re: [techtalk] vi technique for dos2unix

2000-05-04 Thread Sean McAfee
Amanda Babcock <[EMAIL PROTECTED]> wrote: >On Wed, 3 May 2000, Sean McAfee wrote: >>Allow me to suggest a much shorter alternative: >>perl -i -pe 'tr/\015//d' file1 file2 ... >Actually, the key part of Christian's script is even shorter: >>> then cat $1 | tr -d "\015" > $1 >In other words, cat

Re: [techtalk] vi technique for dos2unix

2000-05-04 Thread Amanda Babcock
On Wed, 3 May 2000, Sean McAfee wrote: >Allow me to suggest a much shorter alternative: > >perl -i -pe 'tr/\015//d' file1 file2 ... Actually, the key part of Christian's script is even shorter: >> then cat $1 | tr -d "\015" > $1 In other words, cat file1 | tr -d "\015" > file2. I think this

Re: [techtalk] vi technique for dos2unix

2000-05-03 Thread Sean McAfee
"Christian MacAuley" <[EMAIL PROTECTED]> wrote: >I wrote this script to get rid of the ghastly carriage returns in my DOS >files on my FreeBSD system. >=== >#!/usr/local/bin/tsh > >if test $# -eq 0 > then echo "You didn't enter a filename." >elif test -f "$1" > then cat $1 |

Re: [techtalk] vi technique for dos2unix

2000-05-03 Thread joey tsai
> The Quick'n'dirty way to do this in vi is as follows: > > 1. Open the dos text file in vi. > vi dosfile.txt > 2. Type the following: > :%s/^M//g > ...where you "compose" the ^M character by pressing Ctrl+v then Ctrl+m > 3. Save the file: > :w New.Unix.File.txt If you have

Re: [techtalk] vi technique for dos2unix

2000-05-03 Thread Christian MacAuley
I wrote this script to get rid of the ghastly carriage returns in my DOS files on my FreeBSD system. I use it like this: > nocr dosfile.txt === #!/usr/local/bin/tsh if test $# -eq 0 then echo "You didn't enter a filename." elif test -f "$1" then cat $1 | tr -d "\015" >