user2935002
user2935002

Reputation: 79

bash: syntax error near unexpected token `('

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 `('

Upvotes: 2

Views: 5327

Answers (1)

user1907906
user1907906

Reputation:

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/')\""

Upvotes: 3

Related Questions