il 7 Mar 2004 00:36:04 GMT, Josef 'Jupp' Schugt <jupp / gmx.de> ha
scritto::


>Any to any conversion:
>
>DOS -> UNIX: ruby -p -i.bak -e '$_.sub!(/\r$/,"")' file_name
>DOS -> Mac:  ruby -n -i.bak -e 'print $_.chomp+"\r"'
>
>UNIX -> DOS: ruby -p -i.bak -e '$_.sub!(/$/,"\r")' file_name
>UNIX -> Mac: ruby -n -i.bak -e 'print $_.chomp+"\r"'
>
>Mac -> UNIX: ruby -p -i.bak -e '$_.gsub!(/\r/,"\n")' file_name
>Mac -> DOS:  ruby -p -i.bak -e '$_.gsub!(/\r/,"\r\n")'
>

you can safely omit $_, just use Kernel#gsub that is $_.gsub by itself