直截了当:我需要执行以下操作(伪代码):
if [ -f <file_that_exists> ]
then
while read
do
awk '{print "do stuff for " $1}' THEN immediately below it awk '{print "do stuff for" $2}'
Then continue to next line
我试图解析的文件有两列(如果你愿意的话,主机对):
host_1 host_2
host_3 host_4
我需要的输出如下所示:
Do stuff for host_1
Do stuff for host_2
Do stuff for host_3
Do stuff for host_4
我现在正在尝试的看起来像:
Do stuff for host_1
Do stuff for host_3
Do stuff for host_5
Do stuff for host_7
then
Do stuff for host_2
Do stuff for host_4
Do stuff for host_6
Do stuff for host_8
我不确定我是否说得很清楚,所以如果您需要进一步澄清,请告诉我。
谢谢!