1

So I'm trying to send a bunch of marked files to picard with dired's '&' (dired-do-async-shell-command). In the normal command line this opens one instance of picard with all the selected files:

picard 01\ -\ Snail\ -\ Underwater.ogg 02\ -\ Alain\ Johannes\ -\ Kaleidoscope.ogg 

But in dired when I mark a few files and issue & picard I get two instances of picard.

How does one make dired send all mark files into one picard instance?

2

Please read the docstring of dired-do-shell-command, in particular this part:

If there is a ‘*’ in COMMAND, surrounded by whitespace, this runs
COMMAND just once with the entire file list substituted there.

This means you can run the command once just with & picard * RET.

0

You can use w in Dired to copy the names of the marked files to the kill-ring, for later yanking (pasting).

Then, when you use a command such as & (dired-do-async-shell-command), you can yank that list of files into the shell command input where needed.

  • thx @drew. but what if the application is a GUI app (like picard)? the CLI example was when launching it from shell. if i understand your suggestion, you recommend running a shell after & and from there launching picard FILE1 FILE2. thx! Z – zeltak Feb 14 '17 at 15:06
  • Also: using this methodology you need to manually quote all spaces in each file name in the CLI right? – zeltak Feb 14 '17 at 15:10
  • See Juri @link0ff's answer, which is a much better answer than mine. I knew there was a way to do that, but I'd forgotten what it was (*). – Drew Feb 14 '17 at 23:23
  • For quoting spaces etc. see functionshell-quote-argument. – Drew Feb 14 '17 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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