|
From: | Joe Maimon |
Subject: | Re: [PATCH] [cut] Treat consecutive delimiters as one in cut binary |
Date: | Wed, 10 Mar 2004 14:07:05 -0500 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040219 |
Jim Meyering wrote:
tr is usefull. And I would certainly use that on scripts that dont remain local. But this is a trivial to add feature. And it easily works for whatever delimiter is in use.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.
Thanks for your feedback and for the tip. Joe
[Prev in Thread] | Current Thread | [Next in Thread] |