sudo -H 带大括号
sudo -H with curly brackets
我在 lodash.com 看到了这个安装片段:
$ {sudo -H} npm i -g npm
为什么会有大括号?
两者的区别在哪里:
$ sudo -H npm i -g npm
谢谢!
更新: 查看您的问题的评论。它与 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.
我在 lodash.com 看到了这个安装片段:
$ {sudo -H} npm i -g npm
为什么会有大括号?
两者的区别在哪里:
$ sudo -H npm i -g npm
谢谢!
更新: 查看您的问题的评论。它与 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.