Re: shell tab quoting help?

Paul Eggert <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
> Date: Mon, 17 Jun 2002 17:59:44 -0600
> From: [email protected] (Bob Proulx)
> 
> I find what appears to be the answer in the bash manual which I post
> here:
> 
>   http://mail.gnu.org/pipermail/bug-textutils/2002-June/001258.html
> 
> But I can't find anything in the standards documentation about how to
> quote tabs using $'\t' syntax.

That's because the $'\t' syntax is not standardized by POSIX.

Here's what I do in this situation:

   tab='	' # <-- This is a single tab character.
   sort -t"$tab" -u -k2,2 -k1,1

If you're worried that your shell script's tabs will be expanded, you
can do this instead:

   tab=`awk 'BEGIN {print "\t"; exit}'`
   sort -t"$tab" -u -k2,2 -k1,1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.