Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 0

Automatically Open Directory with Space in Name


eusanpe

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

Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...