how to execute two commands stored in one bash variable

Viewed 5234

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

2 Answers
Related