[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Just want to exclude lines with tabs
From: |
Karl Berry |
Subject: |
Re: Just want to exclude lines with tabs |
Date: |
Thu, 19 May 2016 21:21:18 GMT |
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