Registered Member
|
I am trying to write a bash script that can be passed multiple folders, find(recursively) rar files and extract them. The problem is passing multiple selected folders to the script. The exec line of the service menu is:
Exec=konsole --hold --workdir %f -e searchforarchives.sh %U Note: I am only using konsole for debugging, and will be running the final script from directly in the service menu, the script is in /usr/local/bin/ which shows up in my path. The script itself looks like this:
I have added an echo on line 4 to see what folders are passed to Konsole. If I select 1 folder, it echos back the path and handles extraction as it should. If I try to select 2 folders, and pass them to the script, I get no response from echo and simply launches a Konsole defaulting to ~/Documents. How come %U is not passing multiple folders?
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
Is your script invoked at all? (ie. can you add test echo lines with fixed strings).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Well I can't imagine why the script wouldn't be invoked but I suppose it is possible since konsole does't echo anything for ${input} if multiple folders are selected. If a single folder is selected, then it echos the folder name just fine. As for the echo lines, I am not sure what you mean in this case?
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
I would suggest adding something like the following:
To see if your script is actually being executed or if something else is causing the script to not be invoked by Konsole (which sounds like it could be the case).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Ahh I thought you meant a more elaborate type of echo response. In this case I am not sure how I would provide an echo to see if the script fails to pass to konsole.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Administrator
|
If you add the echo line into your script, then you should see it above the shell which gets launched in Konsole.
Another thing you could try doing is watching the content of ~/.xsession-errors when performing this to see if anything else relevant is output there.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Edit: The answer was in the op. I was using %f and %U in the .desktop file.
Intel Core i7 2600K CPU
MSI P67A-G45 Mobo 2x4GB Corsair Vengance RAM Sapphire Raedon 4890HD Vapor-X GPU 1x180 GB Intel 330 SSD 1x80GB Intel X25-M G2 SSD 2x1TB Western Digital HDDs 2x2TB Wester Digital HDDS Corsair HX520W PSU Thermaltake Mozart TX Case |
Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]