Re: Just want to exclude lines with tabs

Eric Blake <[email protected]> Thu, 19 May 2016 08:42:57 -0600
Newsgroups gmane.comp.gnu.utils.bugs
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 05/18/2016 09:17 PM, xyz2041 wrote:
> Hi,
> 
> I just want to exclude lines that have tabs on them.
> 
> I've tried all of these, but none work.
> 
> What am I missing?

Grep doesn't interpret \t as a valid escape sequence.  This works:

$ printf 'a a\nb\tb\nc c\n' | grep -v $'\t'
a a
c c

if your shell is new enough to have $'' support; otherwise, type a
literal tab in your shell window (often by 'ctrl-v tab' or 'ctrl-v
ctrl-i'), and be sure you properly quote it.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc (application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXPdDxAAoJEKeha0olJ0Nq4loH/2Da1jCH3Dp4bxKGxJVcIc4+
d6OuoUUhWWxLbBT9W7ILzHan0/B+YrHlfj4Ac1tyJFNuyGmVme7WaMrKEUMQ3PYQ
jRJvRhawH/qK4oQTRoZj6xnp4+JkHh8BoRynMWz8L1qXpWeaifxY24xDZ3u0mvjA
5EAoLsayivjtEcJ4YrYhNSBJeKHrl25B0GVGdRQxTAAkRma3KGGL91QYm1Tq9qds
M5rnm5gTo0h0okhz4qoXUerMVl8bnYYjVG/aComqhOLyrmJLL4ds7IbPuDEU5bb2
BT3p5dfFWkr7DzTc+LiaAAq28xNhFTbh1DETuy5mdmS1a1A8o6Uy2cdQ9ATfk5Y=
=skta
-----END PGP SIGNATURE-----