From owner-freebsd-questions Thu Jul 19 11:15:10 2001 Delivered-To: freebsd-questions@freebsd.org Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by hub.freebsd.org (Postfix) with ESMTP id 89C4537B401 for ; Thu, 19 Jul 2001 11:15:00 -0700 (PDT) (envelope-from mi@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.11.4/8.11.4) with ESMTP id f6JIEwO34105 for ; Thu, 19 Jul 2001 14:14:59 -0400 (EDT) (envelope-from mi@aldan.algebra.com) Message-Id: <200107191814.f6JIEwO34105@aldan.algebra.com> Date: Thu, 19 Jul 2001 14:14:55 -0400 (EDT) From: Mikhail Teterin Subject: grep and \t (\r, etc.) To: questions@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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' 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