bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Just want to exclude lines with tabs


From: Eric Blake
Subject: Re: Just want to exclude lines with tabs
Date: Thu, 19 May 2016 08:42:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]