Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use Ubuntu One to sync a Gnumeric spreadsheet. I like to launch the spreadsheet via a script, something like gnumeric /home/daves/data/test.gnumeric

The file in question is now in my Ubuntu One folder. However I cannot use the Ubuntu One name in a script as the resulting script when run reports 'no such file or directory', presumably due to the space in the name Ubuntu One. How can I successfully path this in a script please?

share|improve this question

3 Answers 3

Try: Ubuntu\ One That may help it escape the space.

share|improve this answer

If it is the space bugging you you need to escape it. You can use auto-complete for it.

Example:

$ls
AR Tonelico   Cowon J3  Desktop  lost+found  user_guide_8455_dvb.pdf

'Cowon J3' has a space in it. If I would want to cd into 'Cowon J3' I type 'cd C' and hit tab. Linux fills in the rest and you will see a \ added in front of the space so it would look like this:

cd Cowon\ J3/

Same goes for other special characters like the \ itself (you use 2x \ to escape it).

Same principle works for starting a program with a directory or file as a parameter.

share|improve this answer
    
Thanks for this. Quotes seem simpler and fixed it. –  DaveS May 1 '11 at 19:42

Yeah, either what wojox said, or put "Ubuntu One" in quotes, like that.

share|improve this answer
    
Thanks... the quotes fixed it. So simple when you know :) –  DaveS May 1 '11 at 19:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.