shell IFS

在bash中IFS是内部的域分隔符,manual中对其的叙述如下:
IFS The Internal Field Separator that is used for word splitting after expansion and to split lines into words with the read builtin command. The default value is ''.

#!/bin/sh
IFS="#"
p_commands="./sh01.sh#./sh05.sh"
for w in $p_commands
do
    eval "$w"
done

会本别执行sh01和sh02

如果#IFS="#",运行报错

猜你喜欢

转载自www.cnblogs.com/idyllcheung/p/10281262.html