On Thu, 08 Feb 2001 05:38, Brice Ruth wrote:
> Is there a simple (unix) command I can run on text files to convert
> cr/lf to lf? The way I did it seemed pretty ass-backward to me (not to
> mention time consuming).
This little heiroglyph will convert all text files rescued from that man's
system in a single directory to the format required by the one true way.
for f in `echo *`; # Change this to select files by regex if needed
do
echo $f;
cat $f | tr -d "\015\032" > $f.unix;
mv $f.unix $f;
done
Don't forget to remove the control Z file terminator as well as the
superfluous CRs. It could cause very obtuse problems. Assumes you have
write permission to the directory.