[sf-lug] SFLUG.org ...
Rick Moen
rick at linuxmafia.com
Sat Apr 13 03:11:17 PDT 2019
I wrote:
> [...] Always, the host(1) invocation returns 'not found: 3(NXDOMAIN)',
> and my best guess is there's some weirdness involving quoting and
> subshells -- which is a good guess in shell scripting at the best of
> times.
Re-inventing the thing as a 'for' loop instead of using xargs, I run
into the same problem on the last snippet following the last pipe,
because host(1) isn't getting its intended argument. (Variable $ns is
getting either not dereferenced or wrongly dereferenced.)
$ for ns in $(whois sf-lug.org | grep 'Name Server' | awk '{print $3}'); do host $ns; done
not found: 3(NXDOMAIN)
not found: 3(NXDOMAIN)
not found: 3(NXDOMAIN)
not found: 3(NXDOMAIN)
$
Showing that everything is fine up to the snippet after the final pipe:
$ for ns in $(whois sf-lug.org | grep 'Name Server' | awk '{print $3}'); do echo $ns; done
NS1.LINUXMAFIA.COM
NS.PRIMATE.NET
NS1.SVLUG.ORG
NS1.SF-LUG.ORG
$
Probably something dumb and simple, but I'll have to sleep on it so
as to look at it with fresh eyes.
More information about the sf-lug
mailing list