我是bash-scripting的新手,甚至不知道该如何提出我的问题。我浏览过本教程,但找不到合适的代码示例。这就是我想要的..。
我有一个主机名列表(主机名为google.com等),如下所示:
1,hostname_1
2,hostname_2
...
n,hostname_n我想去掉前面的数字,这是很容易做到的:
originList="originList.txt"
preparedList="preparedList.txt"
ipv6list="ipv6list.txt"
sed 's/[0-9]*,//' <$originList >$preparedList但是,我不想将输出传递给preparedList.txt,而是在我的dig命令中使用它:
sed 's/[0-9]*,//' <$originList | dig **HERE** AAAA +short >> $ipv6List发布于 2016-06-30 11:34:21
用这个:
sed -e 's/^[[:digit:]]*,//' FILE | xargs -I {} dig {} AAAA +short 发布于 2016-06-30 13:24:23
使用裁剪& GNU 并行
cut -d',' -f2 hostnames | parallel 'dig {} AAAA +short'https://stackoverflow.com/questions/38121588
复制相似问题