bash: syntax error near unexpected token `('

2019-07-13 17:03发布

I am trying to install a software, this error coming again and again i have tried some solutions which have suggest for similar errors but not working for me. command is given bellow:

sudo su - -c "R -e \\"install.packages('shiny', repos='http://cran.rstudio.com/')\\""

please help

error:

 bash: syntax error near unexpected token `('

标签: bash shell
1条回答
叼着烟拽天下
2楼-- · 2019-07-13 17:35

Check how you escape the quotes. The argument is:

"R -e \\"install.packages('shiny', repos='http://cran.rstudio.com/')\\""

This can be split into:

  • "R -e \\"
  • install.packages('shiny', repos='http://cran.rstudio.com/')
  • \\""

The ( after packages is wrong shell syntax.

Do this:

sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
查看更多
登录 后发表回答