Jump to content

Photo

Automatically Open Directory with Space in Name

- - - - -

1 reply to this topic

#1
eusanpe

eusanpe

    Newbie

  • Members
  • Pip
  • 8 posts

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



#2
dougbmorris

dougbmorris

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

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.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users