Let's say there is one bash variable
run1="date"
I need to execute date
by
${run1}
And it works, since it prints current time. But if I put two commands in the variable,
run2="date; echo foo"
I can't execute the commands stored in variable run2
, since ${run2}
complains
date;: command not found
Try:
eval ${run2}
This should help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With