我在lodash.com上看到了这个安装片段:
$ {sudo -H} npm i -g npm
为什么有大括号?
区别在于:
$ sudo -H npm i -g npm
谢谢!
答案 0 :(得分:0)
更新:查看您问题的评论。它与bash无关。
bash手册页的摘录。希望这有帮助。
{list; }
list is simply executed in the current shell environment. list must be terminated with a newline or semicolon. This is known as a group command. The return status is the exit status of list. Note that unlike the metacharacters ( and ), { and } are reserved words and must occur where a reserved word is permitted to be recognized. Since they do not cause a word break, they must be separated from list by whitespace or another shell metacharacter.