//eval() is a global function in JavaScript that evaluates a specified string as JavaScript //code and executes it.eval("alert('this is executed by eval()')");
//ORvar x = 10;
var y = 20;
var a = eval("x * y") + "<br>";
var res = a;
Just use eval command for running string output. Asfor example:
eval $cmd #execute command included in string value of $cmd variableOrfor a more sophisticated use run commands storedinlinesof a file:
cat commands_file.txt | whileread line; do eval $line; done