Where Penguins and Daemons chill together in the warmth of the Sun.
Moderators: SecretSquirrel, notfred
posted on Tue Apr 21, 2009 7:47 pm
Alright gurus, I am trying to remove tab spaces from the beginnings of lines in a file. Here's how I'm trying to do it:
sed -e '/^\t*/d' infile > outfile
It results in an empty output file. What am I screwing up?
-
flip-mode
- Lord High Gerbil
-
- Posts: 8735
- Joined: Thu May 08, 2003 11:42 am
- Location: Cincinnati, OH
posted on Tue Apr 21, 2009 7:57 pm
You're deleting all of those lines that match the expression "^\t*" -- a line beginning with 0 or more tabs.
I'd do:
sed -e 's/^\t*//' (substitute the leading tab(s) with nothing)
-
bitvector
- Grand Gerbil Poohbah
-
- Posts: 3234
- Joined: Wed Jun 22, 2005 3:39 pm
- Location: Mountain View, CA
posted on Tue Apr 21, 2009 8:00 pm
LOL. Thanks BV.
-
flip-mode
- Lord High Gerbil
-
- Posts: 8735
- Joined: Thu May 08, 2003 11:42 am
- Location: Cincinnati, OH
posted on Tue Apr 21, 2009 8:01 pm
Heh, yep, that did the trick.
-
flip-mode
- Lord High Gerbil
-
- Posts: 8735
- Joined: Thu May 08, 2003 11:42 am
- Location: Cincinnati, OH
Return to Linux, Unix, and Assorted Madness
Users browsing this forum: No registered users and 2 guests