Mr.Web
Mr.Web

Reputation: 7154

MacOS Terminal go to a folder with spaces and parenthesis

I'm trying to configure Cyberduck to read the Bookmark files from my Dropbox folder.

This is usually accomplished by this command:

defaults write ch.sudo.cyberduck application.support.path ~/Dropbox/Cyberduck

Super easy!!

But... Dropbox has since changed and if you have a Pro Account the Dropbox folder is renamed "Dropbox (Personal)".

I've tried to do this:

defaults write ch.sudo.cyberduck application.support.path ~/Dropbox\ \(Personal\)/

And I get this error:

not parse: [...]/Dropbox (Personal)/Apps/Cyberduck/.  Try single-quoting it.

I tried single quoting like this but same error:

defaults write ch.sudo.cyberduck application.support.path '~/Dropbox\ \(Personal\)/'

How can I solve this?

Upvotes: 4

Views: 9239

Answers (4)

cody.codes
cody.codes

Reputation: 1537

You can single quote escape your parentheses by wrapping them in a double quote:

Instead of: ln -s '/Users/username/Dropbox (Company Name)/' DropboxCompanyName

Do: ln -s "'/Users/username/Dropbox (Company Name)/'" DropboxCompanyName

Notice the double quotes added to /Users/username/Dropbox (Company Name)/

Upvotes: 8

squareman
squareman

Reputation: 649

So I cannot find a way to do a "defaults write" to a path with parentheses, but I did this workaround and it seemed to work for me (in my case I needed to link to my enterprise Dropbox account):

cd to your home folder and create a symlink of the directory that has the parentheses:

ln -s '/Users/username/Dropbox (Company Name)/' DropboxCompanyName

At that point, I was able to do do a defaults write that wrote ~/DropboxCompanyName as part of the path and it worked just fine.

All that said, your personal folder already has a hidden symlink: "Dropbox" that's in the same directory and pointing to "Dropbox (Personal)", so you should be able to do you original command as such:

defaults write ch.sudo.cyberduck application.support.path ~/Dropbox/Cyberduck

… because the "Dropbox" part of the path should still lead to your personal folder. This both what I've observed locally (when viewing hidden files) and what Dropbox says on their site: https://www.dropbox.com/help/9031

Upvotes: 1

Nicolas Martinez
Nicolas Martinez

Reputation: 15

you have to put "" in the whole address

more like this

ch.sudo.cyberduck application.support.path "~/Public/Dropbox (Personal)"

Upvotes: 0

Cam_Aust
Cam_Aust

Reputation: 2789

I am assuming you are using Unix in Terminal.

I have set up a folder of the same name in my Public Folder to test as shown below. enter image description here

Your current referencing to the folder would seem correct. Dragging the folder into the Terminal window current command line will automatically give you the correct referencing to that folder.

As an alternative I suggest putting the name of the folder in double quotation marks. Even though there are brackets in the name, there is no need to escape these characters in Unix in Terminal in this instance when using double quotation marks. This makes it easier to humanly type the correct reference.

To reference a folder in the image below, for example, the following referencing works for the cd (change directory command):

~/Public/"Dropbox (Personal)"

Hence I suggest try:

ch.sudo.cyberduck application.support.path ~/Public/"Dropbox (Personal)"

As for the rest of this command, I am not sure that ch is a valid Unix command. I do not yet have enough Unix experience to guide you from here.

Upvotes: 0

Related Questions