shell处理文本可能没有perl强大,但是在一些特殊用途下也是很出色的,废话少说,直接看如下实例:
IFS=:
echo "Employee Names:"
echo "---------------"
while read name empid dept
do
echo "$name is part of $dept department"
done < ~/source/sinadept.txt
可以看到,根据我们特地的要求输出了确定的值了。
shell处理文本可能没有perl强大,但是在一些特殊用途下也是很出色的,废话少说,直接看如下实例:
IFS=:
echo "Employee Names:"
echo "---------------"
while read name empid dept
do
echo "$name is part of $dept department"
done < ~/source/sinadept.txt
可以看到,根据我们特地的要求输出了确定的值了。