[BASH] How to create your own postprocessingscript

Come up with a useful post-processing script? Share it here!
Posts: 2
Joined: October 20th, 2016, 11:47 am

Re: [BASH] How to create your own postprocessingscript

Post by Spamixxus » October 26th, 2016, 12:13 am

jcfp wrote:
Spamixxus wrote:

Code: Select all

echo $1 $2 $3 $4 $5 $6 $7 $8
python /var/db/sabnzbd/scripts/nzbToMedia/nzbToSickBeard.py $1 $2 $3 $4 $5 $6 $7 $8
python /var/db/sabnzbd/scripts/nzbToMedia/sabtowizznab.py $1 $2 $3 $4 $5 $6 $7 $8
With my sh script, the String is not one line, because the "" are missing.
Proper quoting of variables in your script is your own responsibility. Without quoting, thing go awry as soon as you try to pass an argument that just happens to be empty (these disappear) or contains spaces (one argument becomes multiple).

While you're at it, note there's "[email protected]" as a shorthand for all arguments. So simply /path/to/script "[email protected]" would work just fine without the need to write out $1 through $n.
Thank you very much, now it works all fine.
I use the "[email protected]" in every line.

Code: Select all

python /var/db/sabnzbd/scripts/nzbToMedia/nzbToSickBeard.py "[email protected]"
python /var/db/sabnzbd/scripts/nzbToMedia/sabtowizznab.py "[email protected]"

[02:53:54] [INFO]::MAIN: Loading config from [/media/scripts/nzbToMedia/autoProcessMedia.cfg]
[02:53:59] [INFO]::MAIN: The /media/scripts/nzbToMedia/nzbToSickBeard.py script completed successfully.
uploading file /media/nzbs/nzbbackup/*.gz...

Post Reply