命令替换有两种语法:美元括号和反引号。运行top -p $(pidof init)并top -p `pidof init`给出相同的输出。这两种做同样事情的方式,还是有区别?
top -p $(pidof init)
top -p `pidof init`
command-line shell command-substitution
似乎通常的做法会将 IFS 的设置放在 while 循环之外,以免在每次迭代时重复设置......这只是一种习惯性的“猴子看,猴子做”的风格,就像这只猴子直到我读过man read,还是我在这里错过了一些微妙(或明显明显)的陷阱?
shell text-processing environment-variables
shell ×2
command-line ×1
command-substitution ×1
environment-variables ×1
text-processing ×1