shell 中读取文本的并且
3、使用IFS读文件
说明:默认情况下IFS是空格,如果需要使用其它的需要重新赋值
文件中每一行都是以:分割 且文件名称 通过参数 $1 传进来 读取
其具体解析逻辑为一下
while IFS=:
read field type comment others
do
if [ -z “$comment” ]
then
echo " $field $type"
else
echo " $field typecomment′type comment 'typecomment′comment’ "
fi
done < $1