Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我被 shell 的替换顺序绊倒了。我知道shell会在文件替换之前进行变量替换,这是在解析命令行之前完成的。Shell 可以做许多不同的替换。我只是不知道哪个是第一,第二,第三,等等。有没有人有shell替换的优先级图表?
从人(1)bash:
扩展的顺序是:大括号扩展、波浪号扩展、参数、变量和算术扩展以及命令替换(以从左到右的方式完成)、分词和路径名扩展。