PATH=$PATH
export PATH
cat ttest.dat | awk '{total = $1 + $2 + $3 + $4;
printf "%d %d %d %d %d\n", $1, $2, $3, $4, total; system("echo " total)}'
echo "$total"
if ["$total" -le "20" ]; then
pwd
fi
exit 0
ttest.dat內容
10 10 10 10
11 11 11 11
5 5 5 1
為什麼awk執行完後 我的total裡面就什麼都沒有了。
要怎麼修改我的pwd才會執行到?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 128.138.65.198
→
04/06 11:57, , 1F
04/06 11:57, 1F
推
04/06 12:06, , 2F
04/06 12:06, 2F
→
04/06 12:06, , 3F
04/06 12:06, 3F
→
04/06 12:13, , 4F
04/06 12:13, 4F
推
04/06 12:20, , 5F
04/06 12:20, 5F
→
04/06 12:46, , 6F
04/06 12:46, 6F
→
04/06 14:38, , 7F
04/06 14:38, 7F