1
我發現了一個bash腳本以下命令:
git blame $NOT_WHITESPACE --line-porcelain "${[email protected]}" -- "$file"
是什麼${[email protected]}
是什麼意思?嘗試一下,它會返回第二個參數,如果不存在則返回「@」。 According to the documentation,${2:[email protected]}
應該這樣做。我試過了,它的確如此。有什麼不同?它在哪裏記錄?手冊頁似乎沒有提到這個符號。
請參閱'man bash','Parameter Expansion'。這兩種形式之間沒有區別,但據我記得第二個'$ {2:。@}'應該是首選。 – helpermethod
@helpermethod有一個細微的差別。看到我的答案。 – fedorqui
@fedorqui謝謝你的改正,完全忘了差別。 – helpermethod