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

From Karl Berry <karl@freefriends.org>
Newsgroups gnu.utils.bug
Subject Re: Just want to exclude lines with tabs
Date 2016-05-19 21:21 +0000
Message-ID <mailman.189.1463692894.6543.bug-gnu-utils@gnu.org> (permalink)

Show all headers | 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