How to pass command line arguments to a binary in a PND using pnd_run?


hmc

Active Member
Joined
Dec 19, 2011
Messages
787
Location
Bavaria, Germany
Hi guys,


I'd like to write a script, which starts TrueCrypt with some parameters, so I can assign a keyboard shortcut to that script, and let that keyboard shortcut's script pass the container path as well maybe other options to the truecrypt binary, in order to circumvent the clumsy TrueCrypt GUI.


I have done that on Windows using AutoHotKey already this way, ought to be possible in Linux, too::



Code:
// Sh-Win-C Mount / Sh-Win-X Unmount Truecrypt volume on drive B: (Samba share)

+#c::

Run C:\Programme\TrueCrypt\TrueCrypt.exe /v b:\encrypted.tc /lz /q /e

return


+#x::

Run C:\Programme\TrueCrypt\TrueCrypt.exe /q /dz

SplashTextOn, 200, 100, TrueCrypt Unmount, Truecrypt volume unmounted.

sleep 3000

SplashTextOff

return


(Truecrypt asks for a password in a small simple password dialog, when called this way for mounting, at least on Windows).


But how can I pass command line arguments to the binary inside the PND file, when started using pnd_run?


I didn't find any documentation describing this.


Thanks,


Daniel
 
yes this can be done, dont know the exact command right now but if you run



Code:
pnd_run --help


from terminal if shows you how :)
 
You can replace the runscript in the pnd on the fly, when creating a script, thats filename is the same, as the script in the pnd. Then put it in the appdatafolder, where the original runscript is located.


For example, if the runscript launched in the pnd is scripts/run.sh, create a folder called scripts in the appdatadir and create a script called run.sh in that folder.


Put what you want into that script and run the pnd.
 
Last edited by a moderator:
@milkshake: almost ;) It's "pnd_run.sh"


Run "pnd_run.sh" without anything else for a short help.


Here is an example:



Code:
pnd_run.sh -p /media/trans8/pandora/menu/snes9x4p_20111010.pnd  -e "snes.sh" -a "/media/trans8/multimedia-data/snes/SuperMarioWorldEurope.zip" -s . -b snes9x.skeezix.alpha


That would run the "snes.sh" script in the snes-pnd and pass the parameter behind "-a" to it.


See also :http://pandorawiki.org/Pnd_run.sh
 
Last edited by a moderator:
yes this can be done, dont know the exact command right now but if you run



Code:
pnd_run --help



from terminal if shows you how :)


No, it doesn't. Thats what I tried...

Code:
pandySD:/media/SD16GP2FAT/pandora/menu$ pnd_run --helppnd_run [-r runscript] [-n] [-X] path-to-pndfile-r      Optional. If not specified, will attempt to suss from configs.-X      Optional. If present, run sub-app number 'X'; ex: -0 for first, -1 for second, etc.pndfile Required. Full path to the pnd-file to execute.
Daniel
 
@milkshake: almost ;) It's "pnd_run.sh"


Run "pnd_run.sh" without anything else for a short help.


Here is an example:



Code:
pnd_run.sh -p /media/trans8/pandora/menu/snes9x4p_20111010.pnd  -e "snes.sh" -a "/media/trans8/multimedia-data/snes/SuperMarioWorldEurope.zip" -s . -b snes9x.skeezix.alpha


That would run the "snes.sh" script in the snes-pnd and pass the parameter behind "-a" to it.


See also :http://pandorawiki.org/Pnd_run.sh

Ah, thanks! :)will try it that way.I didnt realize that there is a pnd_run binary and a pnd_run.sh script. Quite confusing if both have the same basename.Daniel
 
You can replace the runscript in the pnd on the fly, when creating a script, thats filename is the same, as the script in the pnd. Then put it in the appdatafolder, where the original runscript is located.


For example, if the runscript launched in the pnd is scripts/run.sh, create a folder called scripts in the appdatadir and create a script called run.sh in that folder.


Put what you want into that script and run the pnd.

Albeit thats good to know and could be very interesting in some situations, I don't think it will help me in this situation.But thanks anyway! Good to know!Daniel
 
i dont understand why there is pnd_run.sh and pnd_run I thought they were meant to be the same? whats the differece?
 
I don't know exactly what features "pnd_run" has got. All i can say, is that it's a binary, that I only use, when i want to launch a pnd from a terminal with the default application and without passing parameters in any way. Simply "pnd_run pndname.pnd".


And for mounting/unmounting a pnd without launching it's content or when i want to run something within the pnd in a modified way, then i use the script "pnd_run.sh".
 
Last edited by a moderator:
By the way, is EvilDragon around here on these boards, too? He should be qualified best to comment on this.


Daniel
 
Yes he is, but I think sebt3 would be more qualified, as he has redone a huge portion of pnd_run in the last hotfix.
 
You could mount the .pnd with first with pnd_run.sh, ("sudo pnd_run.sh pndname -m" i believe) and then run the binary directly too.
 
Back
Top