[Nottingham] Quick! I need a bash one liner!

Michael Erskine msemtd at yahoo.co.uk
Tue Feb 1 16:41:35 GMT 2005


On Tuesday 01 February 2005 16:33, Martin wrote:

> for file in *.[ch] ; do mv $file $file.bak ; expand -t 4 $file.bak
>  >$file ; done

Good work! I can say this because it's essentially the same thing I came up 
with :)

> > ...I guess this probably worked (not checked yet! I'd like to grep for
> > '\t' but it doesn't seem to act like perl and grep -P says "not
> > supported") but I'm curious whether this "script" can be issued as a
> > one-liner - anyone?
>
> ???
>
> grep & egrep will search for tabs:
>
> egrep -e '\t' yourtabbedfile
>
> works as expected.

Not for me! It finds all files that contain 't'!

  michael at debian:~/lss/patched-code$ echo "no tabs here" > notabs
  michael at debian:~/lss/patched-code$ egrep -e '\t' notabs
  no tabs here

Regards,
Michael.


-- 
To lead people, you must follow behind.
  -- Lao Tsu



More information about the Nottingham mailing list