我正在为 Bash 变量扩展而苦苦挣扎。请看以下代码:
~/tmp 689$ a=~/Library/Application\ *; echo $a
/Users/foo/Library/Application *
~/tmp 690$ echo ~/Library/Application\ *
/Users/foo/Library/Application Scripts /Users/foo/Library/Application Support
由于扩展的顺序是大括号->波浪号->参数->....->路径名,为什么路径名扩展不像$a
第二个命令那样适用?
[添加]
空格转义是否对以下输出有隐藏行为?
~/tmp 705$ a=~/Library/Application*; echo $a
/Users/foo/Library/Application Scripts /Users/foo/Library/Application Support