Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
Error: unexpected '/'
I just got over this simply by su to root, fire up an R, and ran the command line within the R environment.
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
Then, as the line is already using single quotes too, he would have single quotes within single quotes, not a real improvement :-(
I see I didn't study it carefully enough. I was going for '..."...'...'..."...' - such that the second set of singles were inside the doubles, which should be OK, theoretically.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.