Jump to content
funtoo forums
  • 0
Sign in to follow this  
eusanpe

Automatically Open Directory with Space in Name

Question

Hello All,

 

I am messing with Devmon to automatically mount a USB drive. The command I have in a config file is:

devmon --exec-on-drive "pcmanfm %d"

This will open all directories on a mounted USB drive when the drive is inserted. This works great for one word directories. The issue is when opening a directory when it has a space in the name (two word directories). I get an error message that it isn't recognized. I tried using Dolphin and the same thing happens. If I open PCManFM or Dolphin manually then things are fine. How can I open them automatically?

 

Thanks,
Tony

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi, Tony. I didn't get very far in my experiments with Leechcraft. I can't only guess that you need escape nesting for the bash interpreter, something like "pcmanfm '%d'". I have found that studying the manpage for bash in detail for the basic bash command-line language is invaluable. Bash splits on spaces. If you make the sibling directories 'a', 'b', and 'a b' (a.k.a. a\ b if no containing quotes) and try for 'a b', I wonder if you would get a or a and b. Spaces are often trouble in bash scripts, at least for me. Our BDFL prefers Python. It's a great script language and then some.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...