处理sed-(流编辑器) - 进一步输出(Process sed-(stream editor)-output further)
我是一个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 >> $ipv6ListI'm a bash-scripting newbie and don't even know how to formulate my question. I've skimmed this tutorial, but couldn't find an appropriate code example. This is what I want...
I have a list of hostnames, (hostname being google.com and such), which looks like:
1,hostname_1 2,hostname_2 ... n,hostname_nI want to remove the number in the front, that can be easily done with:
originList="originList.txt" preparedList="preparedList.txt" ipv6list="ipv6list.txt" sed 's/[0-9]*,//' <$originList >$preparedListBut instead of piping the output to preparedList.txt I'd like to use it in my dig command:
sed 's/[0-9]*,//' <$originList | dig **HERE** AAAA +short >> $ipv6List最满意答案
用这个:
sed -e 's/^[[:digit:]]*,//' FILE | xargs -I {} dig {} AAAA +shortuse this:
sed -e 's/^[[:digit:]]*,//' FILE | xargs -I {} dig {} AAAA +short更多推荐
发布评论