On Mon, Dec 13, 1999 at 02:47:49PM -0600, John Foster wrote:
> I have a working command called "fromdos" on my test system which is a
> box that has been upgraded from bo to hamm to slink to potato. It also
> uses the dos2unix symlink. Does anyone know where the current .deb
> package for this can be found. I am building a new server and this
> command is "NECESSARY" for it to do the intended job. There may be some
> other pkg that will do the trick but I have not found one. The purpose
> is to use it to convert database files from DOS/pc to Unix/Linux format.
> I tried copying the old file from my old box to the new one, but it does
> not work, it segfaults. Thanks!

Not sure if I found it on my Debian system or not, but I cobbled this up
for someone else... should work on most Unix systems:

-----------------------------
#!/bin/sh
# a script to strip carriage returns from DOS text files
# WARNING: may modify and delete files, may cause data loss

# Handle stdin
if [ $# -eq 0 ]
then
    tr -d '\r'
fi

for file in $*
do
    if [ -f $file ]
    then
        tr -d '\r' < $file > $file.tmp \
            && ( cp $file.tmp $file; rm $file.tmp )
    fi
done
-----------------------------

-- 
William Burrow -- New Brunswick, Canada
A 'box' is something that accomplishes a task -- you feed in input and
out comes the output, just as God and Larry Wall intended.
                                         -- brian moore
Composed: 5:12pm

Reply via email to