[Top][All Lists]

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

Re: shell tab quoting help?

From: Paul Eggert
Subject: Re: shell tab quoting help?
Date: Mon, 17 Jun 2002 21:37:00 -0700 (PDT)

> Date: Mon, 17 Jun 2002 17:59:44 -0600
> From: address@hidden (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

reply via email to

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