[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] [cut] Treat consecutive delimiters as one in cut binary
From: |
Jim Meyering |
Subject: |
Re: [PATCH] [cut] Treat consecutive delimiters as one in cut binary |
Date: |
Wed, 10 Mar 2004 19:00:01 +0100 |
Joe Maimon <address@hidden> wrote:
> When using the -d option I find it frustrating that arbitrary whitespace
> ruins the field count.
>
> witness this script:
>
> dig -x $addr +noall +answer | grep -v '^;' | grep -v '$^' | expand | cut
> -d' ' -f5 -z
>
> With the new option in this patch, you can rely on the behavior to
> produce a hostname if there is one. Otherwise you cant.
How about filtering the output through tr -s ' ' just before cut?
Then your script won't have to rely on less-portable features.