![]() Registered Member ![]()
|
Is there a full guide to KDE service menus somewhere?
I am just trying to create a bash script that operates on several selected files but I can't make it/him/her understand that there are several filenames in $@. |
![]() Manager ![]()
|
Service menu tutorials:
http://techbase.kde.org/Development/Tut ... vice_Menus http://oreilly.com/pub/h/3156 can your script cycle thought the arguments passed? something like: # Loop through the command line arguments ARGV=("$@") for((n=0;n<$#;n++)); do furl=${ARGV[$n]} done there's an interesting take on this here viewtopic.php?f=43&t=93784 (where I got the above code example) |
![]() Registered Member ![]()
|
First of all, thanks for the links!
The problem is that "%U" passes to the script a single string containing for example: "/home/darwin/old backup/1.txt /home/darwin/old backup/2.txt", etc. What I need is to make the service menu pass the filenames separately or with some kind of delimiter. If I am not mistaken, your solution points to trying to dissect the multiple instances after they have been passed to the script as one long string, and I don't see how to differentiate the empty spaces which are delimiting the filenames from the empty spaces that are inside the file's name. EDIT: I don't understand the syntax of the "for" line that you proposed, but it seems to do the same as using "%F" "%N" in the Service Menu. |
![]() Manager ![]()
|
suggest you post in forum: KDE Development -> Helping hands
explicitly mentioning passing filenames w/spaces from service menu to bash script |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]