文本:

[root@VM_0_84_centos ~]# cat sshd.txt 
1 2 3
4 5 6
7 8 9

循环打印上述文本

for 循环的固定格式   i=1设置i的初始变量  i<=NF i变量小于等于 NF变量的值(每行的字段数) i++ 表示i递增+1,

[root@VM_0_84_centos ~]# cat sshd.txt |awk '{for(i=1;i<=NF;i++){print $i}}'
1
2
3
4
5
6
7
8
9

  

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2021-10-14
  • 2021-08-05
  • 2022-01-09
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案