|
$*A list of all the parameters, in a single varible, separated by the first character in the environment variable IFS. If IFS is modified,
then the way $* separates the command line into parameters will change.
在一个变量中列出所有参数,这些参数并以环境变量 IFS 的第一个字符进行分隔。如果 IFS 改变,那么分隔的方式也会改变。
IFS=:
set foo bar bam
echo "$*" 结果输出:foo:bar:bam
注意,若对 IFS 设置成如 :::::: ,尽管此时 IFS 的值已经为 :::::,但在 echo "$*" 也只是取出 IFS 值中的第一个字符,即 : 进行参数的分隔。
尝试改变一下 IFS 变量,然后看其输出:输出结果:foo~bar~bam
释放 IFS ,可使用命令: unset IFS |
|