标签:bash man ash font done and line lin com
关键词:IFS
作用:自定义分隔符
脚本:
[root@test tansk]# cat test.sh #!/bin/bash IFS num=$( cat /root/tansk/ifs.txt ) IFS=‘,‘ for i in $num do echo "*******$i******" done [root@test tansk]# cat ifs.txt a,b,c,d,f,g
实现效果:
[root@test tansk]# ./test.sh ./test.sh: line 2: IFS: command not found *******a****** *******b****** *******c****** *******d****** *******f****** *******g****** [root@test tansk]#
标签:bash man ash font done and line lin com
原文地址:https://www.cnblogs.com/tanshouke/p/12405545.html