Problem building on BeOS...

Donn Cave donn at u.washington.edu
Fri Jan 2 22:56:00 CET 2004


In article <8zjJb.725764$Tr4.1845399 at attbi_s03>,
 Zoo Keeper <candiazoo at comcast.net> wrote:

> Is there a way to strip'em?  I see "cr nl".  :/

Certainly.  From the Terminal shell (where you ran "od"),

  $ tr -d '\r' < oldfile > newfile 

or if you want to use a more complicated procedure
(and untested)


#!/bin/sh
#
case $# in
0)  echo Usage: strip file [file ...] >&2 ;;
esac
new=uncr.$$
for file
do
    tr -d '\r' < $file > $new
    if cmp $file $new > /dev/null 2>&1
    then
        rm $new
    else
        save=$file.dist
        test -e $save || mv $file $save
        mv $new $file
    fi
done

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list