How to declare the variable content when running the script?
I know that is possible to use $1 $2 $3 to set a variable when running the script ./script.sh this is sparta
, but I did not found a way to set explicit.
Like
./script.sh URL=www.google.com COMMAND=wget
This is possible?
If you invoke it with the variable declarations before the command, bash will put those variables in the environment created for that command. After the command, the variables will no longer exist in the current shell:
Reference: http://www.gnu.org/software/bash/manual/bashref.html#Simple-Command-Expansion