Originally posted by Xplorer4x4
View Post
As for $1 and $2, could you elaborate?
url=${1}
To set up the $url variable using the first argument of your command, but if you Exec= something like:
script mktorrent1 %U
then the url is going to be the second argument $2
(You can then use $1, which will be 'mktorrent1' to call the correct function in your script, for example...so you can have functions 'mktorrent1' and 'mktorrent2' and use the first argument ($1) to choose which function you want to execute...of course you don't need to do it with separate functions, you can just check the arguments and let the script behave accordingly with 'if' or 'case' statements, as in 'if the first argument $1 is this...do this' etc.)

Leave a comment: