groad
linux abcdef
shell
beyes kkkwedia
#!/bin/sh
for line in `cat user.txt`
do
echo $line
done
sh readfile_for.sh
groad
linux
abcdef
shell
beyes
kkkwedia
#!/bin/sh
cat user.txt | while read line
do
echo $line
done
#!/bin/sh
while read line
do
echo $line
done < user.txt
groad
linux abcdef
shell
beyes kkkwedia
#!/bin/sh
while read line
do
username=`echo $line | awk '{print $1}'`
password=`echo $line | awk '{print $2}'`
echo "--------------------"
echo $username "++++++++" $password
done < user.txt
--------------------
groad ++++++++
--------------------
linux ++++++++ abcdef
--------------------
shell ++++++++
--------------------
beyes ++++++++ kkkwedia
bzhao:你提到的区别的贡献者是read的! (2012-10-14 23:40)
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |