[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: sed - trouble matching end of line
- From: Cameron Simpson <cs zip com au>
- To: redhat-list redhat com
- Subject: Re: sed - trouble matching end of line
- Date: Thu Oct 30 19:48:01 2003
On 16:17 30 Oct 2003, Kunkel, Mark <mckunkel essvote com> wrote:
| We are attempting to use sed to remove blank lines from a stream with:
|
| sed '/^[ ]*$/d'
|
| where the brackets contain a space and a tab. This works with cygwin, but
| not on RedHat 8.
|
| Both systems report the sed version as 3.02
|
| I have two questions.
|
| 1.) Does anyone know that this has been corrected in a newer version of sed?
I doubt it's a sed bug. (It has them, but not something this basic).
| 2.) Does anyone know of another way to match end of line with sed?
You're doing it right.
Check:
that you really have a space and a tab in there, rather than
some cut/paste accident with a bunch of spaces and no tab
that the data file is a nice clean UNIX file - no DOS line endings
in it. The latter will show as ^M at the end of the line in vi.
"od -c" will also make this obvious.
How did the data file get to your UNIX box?
Maybe you need to dos2unix the data file.
Cheers,
--
Cameron Simpson <cs zip com au> DoD#743
http://www.cskk.ezoshosting.com/cs/
Here's a great .sig I wrote, so good it doesn't rhyme.
Jon Benger <jbenger agravaine st nepean uws edu au>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]