shell while loop
shell while loop
2023-09-14 09:08:39 时间
下面是一组准备好的数据,数据放到test123.txt 中
12 tf 23 13 米勒 24 14 西安电子科技大学 90 15 西安交大 90 16 北京大学 90
如果,我要提取第三列
第一种方式
cat test123.txt|while read id name age do echo $age done
第二种方式, 第二种方式是主流,因为传说性能是最好的
while read id name age do echo $age done < test123.txt
输出的结果就是
23 24 90 90 90
相关文章
- shell编程-----while、until、case、select语句
- linux中shell脚本启动和停止jar包程序性模版
- Shell入门教程:流程控制(6)while 循环
- Shell入门教程:Shell函数的返回值
- 【shell】while read line 与for循环的区别
- 实用脚本----Linux下Jdk和Tomcat自动安装shell脚本总结
- 大叔经验分享(48)oozie中通过shell执行impala
- EOF ---shell编程
- linux登录系统时shell读取的顺序
- linux shell for while if case break continue echo test 及算术运算符 关系运算符 布尔运算符 逻辑运算符 字符串运算符 文件测试运算符
- [Shell] 条件判断与流程控制:if, case, for, while, until
- 三白话经典算法系列 Shell排序实现
- Shell while 语法
- Shell脚本:while read line无法读取最后一行的问题
- linux bash shell 统计一个文本中 单词 频率的 脚本详解
- Shell脚本实战之查看当前系统的环境变量
- Shell脚本实战之生成日志文件
- Shell基础— 环境变量全套