ash读文件 for循环

busybox sh 是ash
InputFile="ip.txt"
while IFS= read -r line <&3; do
  printf '%s\n' "$line"
done 3< "$InputFile"
https://unix.stackexchange.com/questions/87301/busy-box-read-file-line-by-line

array="a b c"
for i in $array
do
echo $i
done

数组赋值

while IFS= read -r line <&3; do
# printf '%s\n' "$line"
eval arr$i=$line
let i+=1
echo $i
done 3< "$InputFile"

posted @ 2022-06-23 00:06  MoonXu  阅读(348)  评论(0)    收藏  举报