I want to execute a string command and then get the result of it to assign a variable in shell script bash. for example :
strCode="scontrol show jodid --dd $VALUE"
eval $strCode
The point here is this codepart worked but how can I get the results from the `
eval
` command and assign it to a variable, because I need it to use.
when I type the theResult=eval $strCode
it does not work.
thanks for the help