**已关闭。**此问题为not reproducible or was caused by typos。目前不接受答案。
这个问题是由一个打字错误或一个无法再重现的问题引起的。虽然类似的问题在这里可能是on-topic,但这个问题的解决方式不太可能帮助未来的读者。
昨天关门了。
Improve this question
我有下面的脚本:
#!/bin/bash
while read -r i; do
autorep -j $i -q | grep -e insert_job -e date_conditions -e condition | awk '{print ($2,$4,$6)}'
echo
done
我得到输出
Test_Kill CMD
0
Test_Karthik CMD
0
Test_Ujjal CMD
0
Test1 CMD
0
当我将脚本修改为:
#!/bin/bash
while read -r i; do
autorep -j $i -q | grep -e insert_job -e date_conditions -e condition | awk 'BEGIN { ORS=" " }; {print ($2,$4,$6)}'
echo
done
输出如下:
Test_Kill CMD 0 Test_Karthik CMD 0 Test_Ujjal CMD 0 Test1 CMD 0
我正在寻找的是,如果我可以得到如下输出:
Test_Kill CMD 0
Test_Karthik CMD 0
Test_Ujjal CMD 0
Test1 CMD 0
编辑:
下面是autorep输出
autorep -j test_ujjal -q
/* ----------------- test_ujjal ----------------- */
insert_job: test_ujjal job_type: CMD
command: echo
machine: vservername
owner: owner
permission:
date_conditions: 0
description: "test job"
alarm_if_fail: 0
alarm_if_terminated: 0
1条答案
按热度按时间8e2ybdfx1#
假设您的
autorep
输出为:下面的
awk
可能适合您:autorep
输出存储在文件ar.out
中的示例: