linux shell 按行读入文件
#/bin/bash
printf"*************************************\n"
echo"catfilewhilereadline"
cattest.txt|whilereadline
do
echo$line;
done
printf"*************************************\n"
echo"whilereadline<file"
whilereadline
do
echo$line;
done<test.txt
printf"*************************************\n"
echo"forlineincattest.txt"
SAVEIFS=$IFS
IFS=$(echo-en"\n")
forlinein$(cattest.txt)
do
echo $line;
done
IFS=$SAVEIFS
相关推荐
laisean 2020-11-11
Julyth 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
tianhuak 2020-11-24
huha 2020-10-16
lianshaohua 2020-09-23
zhangjie 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
以梦为马不负韶华 2020-10-20
CARBON 2020-10-20
彼岸随笔 2020-10-20
lianshaohua 2020-10-20
yutou0 2020-10-17
JohnYork 2020-10-16