I have a text file with variables in format VARIABLE=value
like:
PID=123123
WID=569569
TOKEN=456456456
Where VARIABLE
has only uppercase letters and value
contains only alphanumeric characters ([a-zA-Z0-9]
)
Now I want to pass these variables to a script as named arguments (options):
./script.sh --PID 123123 --WID 569569 --TOKEN 456456456
Is there a simple way to do this in bash?
I have read:
- How to pass command line parameters from a file - this question is about position arguments and named arguments
- Set environment variables from file of key/value pairs - this question is about environment variables