dos2unix

./tgpub/area/dos2unix · 240 B

From the archive gathering1.01.tar.gz

Download the archive   « Back to the archive contents

#!/bin/sh
tmp=tmptmp.$$
trap "rm -f $tmp" 0 1 2 3 15
action=DOS
[ `basename $0` = "dos2unix" ] && action=Unix
for i
    do
mv $i $tmp
if [ $action = DOS ]
then gawk 'BEGIN {ORS = "\r\n"};1' $tmp > $i
else tr -d '\r' < $tmp > $i
fi
    done

Site Stats

Snippets: 1791
Codebases: 571