sudo -H用大括号括起来

时间:2015-01-27 12:49:10

标签: linux bash shell

我在lodash.com上看到了这个安装片段:

$ {sudo -H} npm i -g npm

为什么有大括号?

区别在于:

$ sudo -H npm i -g npm

谢谢!

1 个答案:

答案 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.