awk 打印每一个值

Linux 运维以及脚本干货: 欢迎分享,欢迎folk
https://unnunique.github.io/AADocs/skill-docs/linux/
https://github.com/unnunique/unnunique.github.io/blob/master/AADocs/skill-docs/linux/index.md

awk 打印每一个值

for host in $(echo "hello,niya" | awk -F ","  '{for(i=1;i<=NF;++i) print $i}');do
  echo $host
done

你可能感兴趣的:(Linux)