Jim Meyering wrote:


Joe Maimon <[EMAIL PROTECTED]> 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.




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.
Thanks for your feedback and for the tip.


Joe


_______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to