Re: grepping for tabs
Incoming from dircha:
> William Ballard wrote:
> >I searched google a bit, nothing jumped out:
> >
> >Suppose the file '1' words seperated by tabs:
> >host cookie 8 www.execsoft.co.uk
> >
> >$ grep '\b8' 1
> >host cookie 8 www.execsoft.co.uk
> >$ grep '\t8' 1
> >$ grep "`echo -e '\t'`8" 1
> >host cookie 8 www.execsoft.co.uk
> >
> >I could have sworn that shells natively understood \t as tab,
> >but apparently the only way to pass one to a shell is with
> >`echo -e '\t'`, or `echo -e \\\\t`.
>
> I think the following is what you want:
>
> $'\tsomething'
grep <CTRL>qblah 1
Control-q is the same thing you do in vi to get the literal character.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling
- -
Reply to: