Linux Shell中 While循环语句
while 条件语句
do
...
# continue / break / exit
done
例, while读取 fruitlist.txt 文件内容:
#!/bin/sh
no=1
while read line
do
echo "${no}. ${line}"
no=$((${no}+1))
done < fruitlist.txt
Linux Shell中 While循环语句
while 条件语句
do
...
# continue / break / exit
done
例, while读取 fruitlist.txt 文件内容:
#!/bin/sh
no=1
while read line
do
echo "${no}. ${line}"
no=$((${no}+1))
done < fruitlist.txt