Can I use ECHO to execute commands?
A simple way that won't need modification of your script would be to pipe the command's output to another bash instance. Like this:
yourscript | bash -
The -
tells bash that it should read commands from stdin.
However, if you are not searching for a quick solution, it is possible to build and execute the command dynamically as well. Like this:
cmd="ls"if [ "foo" != "bar" ] ; then cmd="$cmd -a"then# ... and so on# now execute it:$cmd