Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.utils.bug > #2207

Re: Just want to exclude lines with tabs

From Eric Blake <eblake@redhat.com>
Newsgroups gnu.utils.bug
Subject Re: Just want to exclude lines with tabs
Date 2016-05-19 08:42 -0600
Organization Red Hat, Inc.
Message-ID <mailman.157.1463668985.6543.bug-gnu-utils@gnu.org> (permalink)
References <CAAY=KgOd0CYkx43xZ7WQ1SFj3mABziKEiueN6JohZvHM0rin5Q@mail.gmail.com>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to gnu.utils.bug | Previous | Next | Find similar


Thread

Re: Just want to exclude lines with tabs Eric Blake <eblake@redhat.com> - 2016-05-19 08:42 -0600

csiph-web