Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2001 14:14:55 -0400 (EDT)
From:      Mikhail Teterin <mi@aldan.algebra.com>
To:        questions@freebsd.org
Subject:   grep and \t (\r, etc.)
Message-ID:  <200107191814.f6JIEwO34105@aldan.algebra.com>

next in thread | raw e-mail | index | archive | help
Hi!

I'm trying to clean up the HTML pages from the MSDOS-style
EOL characters. Actually removing them is easy:

	tr -d \\r < in > out

does wonders, and, even better (removes spaces at EOL too):

	perl -pi -e 's/[\r ]+$//g' <file list>

seems to work, but to find them (I don't want to touch the "good"
pages). I can not think of anything but grep. Which I can not make
work :( For example:

	find . -type -name '*.htm*' | xargs grep -E '\r$'

just keeps listing all lines which end with ``r''... Any clues?

I guess, I'll just write a mini-script in TCL to do checking and
rewriting, but this seems like a problem with grep to me...
Thanks!

	-mi


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107191814.f6JIEwO34105>