I'm using Dolphin in a KDE Plasma 5 Desktop Environment. Here I wrote a bash script, which can elaborate exactly ONE file, when I drag a file from Dolphin and drop it on a ".desktop" defined script with an icon, which then executes e.g. /home/user/scripts/list_all_drags.sh %f.

This works with such one file. Now I would like to drag several selected files from Dolphin into the script and the script should elaborate its procedures for each file entry. This doesn't work, though I used %F for multiple files instead of %f for a single file.

What happens is, that several terminal windows are opened, one for each file entry. What I need is the code to be executed in ONE script, for each file entry dropped, without opening several terminal windows, but the first one. Exactly, the "loop" to start or to execute the commands with the dropped files, without any more key press.

I don't know how to handle the %F parameter value in my script.

1 Answer 1


I think, I've found the correct answer, especially how to handle the multiple parameters with %F.

First I select my entries (files) in a filemanager. Second I drag all these marked files onto my script icon and drop them on that icon. Inside this script which is executed with "/home/user/scripts/myscript.sh %F" there is a routine, which elaborates all selected file entries.

Though I'm not sure how many parameters (files) could be mass selected and elaborated then, this routine here helps me to count up all single parameters greater than 0 (which are my selected, my marked files):

while (( $# > 0 )) # or [ $# -gt 0 ] do echo "$1" shift done

Instead of "echo $1" I can say

file = $1

and then call my subroutine where I work with $file

Special thanks to this post: How to handle more than 10 parameters in a shell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .