why it complains: Unmatched ".
On a RedHat 7, it complains
Unmatched ". when I ran this command line: sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\"" on both tcsh and bash. .. I wonder what was wrong? How can I get over this? Thanks in advance! julian |
Quote:
You have double quotes within double quotes. Try changing the outermost quotes to single quotes. |
Thank you for the reply.
If I change outer pair of double quotes to single quotes, then it brings up problems with other single quotes in the command line, causing Quote:
I would like to follow this problem because it's copied command line from a tutorial, which imply it worked for many others. I just wonder why it didn't work in my bash/tcsh on RH7. |
first of all you do not (must not) use sudo and su together, most probably sudo is the [only] one you need.
Next: if you have a situation like this (quotation problems) try to write a working shell script (without sudo) and finally just sudo <your script> will do the job. It is not bash/tcsh and/or RH7, but incorrectly formulated command. (probably you made a mistake when you copied it from that tutorial). By the way which tutorial is it? finally you may find shellcheck.net useful to catch this issue. |
I agree with pan64's suggestion of placing in a script, but if you do still want to use varying types of quotes, I would suggest you look into heredocs
|
Quote:
|
Quote:
|
All times are GMT -5. The time now is 11:39 AM. |