shell while 读行
$ cat test
1
22
33 3
-
while-read.sh
# while-read: read lines from a file
count=0
while read; do
printf "%d %s\n" $REPLY
count=$(expr $count + 1)
done <$1
执行:
$ bash wile_read.sh test
1
22
33 3
count:3
shell while 读行
阅读 26
2022-06-11
$ cat test
1
22
33 3
while-read.sh
# while-read: read lines from a file
count=0
while read; do
printf "%d %s\n" $REPLY
count=$(expr $count + 1)
done <$1
执行:
$ bash wile_read.sh test
1
22
33 3
count:3
相关推荐
精彩评论(0)