阅读背景:

Linux:IFS分隔符的使用

来源:互联网 

IFS分隔符的使用

data="name, gender,rollno,location"
我们可以使用IFS读取变量中的每一个条目。
oldIFS=$IFS
IFS=, #IFS现在被设置为,
for item in $data;
do
echo Item: $item
done
IFS=$oldIFS
输出如下:
Item: name
Item: gender
Item: rollno
Item: locationdata="name, gender,rollno,location"



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: