Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.utils.bug > #2210

Re: Just want to exclude lines with tabs

Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From Karl Berry <karl@freefriends.org>
Newsgroups gnu.utils.bug
Subject Re: Just want to exclude lines with tabs
Date Thu, 19 May 2016 21:21:18 GMT
Lines 14
Approved bug-gnu-utils@gnu.org
Message-ID <mailman.189.1463692894.6543.bug-gnu-utils@gnu.org> (permalink)
NNTP-Posting-Host lists.gnu.org
X-Trace usenet.stanford.edu 1463692896 3553 208.118.235.17 (19 May 2016 21:21:36 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-gnu-utils@gnu.org
To xyz2041@gmail.com
Envelope-to bug-gnu-utils@gnu.org
X-Envelope-From karl@freefriends.org
X-Authentication-Warning frenzy.freefriends.org: nobody set sender to karl@freefriends.org using -f
In-Reply-To <CAAY=KgOd0CYkx43xZ7WQ1SFj3mABziKEiueN6JohZvHM0rin5Q@mail.gmail.com>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 3.x
X-Received-From 96.88.95.60
X-BeenThere bug-gnu-utils@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU utilities <bug-gnu-utils.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-gnu-utils/>
List-Post <mailto:bug-gnu-utils@gnu.org>
List-Help <mailto:bug-gnu-utils-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.utils.bug:2210

Show key headers only | View raw


    grep "$(printf '\t')" o.csv

It seems to me this should have worked, unless your shell's quoting got
rid of the \ before printf could see it.  Certainly this works:

tab=`printf '\t'`  # or $(...), whatever
grep "$tab" somefile

This assignment of special characters to shell variables and then using
the variable in subsequent commands is the most portable (across decades
and "improvements" in standards, shells, systems, ...) approach I know
of.  FWIW.  -k

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


Thread

Re: Just want to exclude lines with tabs Karl Berry <karl@freefriends.org> - 2016-05-19 21:21 +0000

csiph-web