把一个文本文档中只有一个数字的行给打印出来
时间:2021-02-27 13:00:32
收藏:0
阅读:0
题目要求
用shell实现,把一个文本文档中只有一个数字的行给打印出来。
参考答案
#!/bin/bash while read line do n=`echo $line |sed ‘s/[^0-9]//g‘|wc -L` if [ $n -eq 1 ] then echo $line fi done < 1.txt
评论(0)