I tried to run this script:
my_cmd="echo -n 0"
if [ $($(my_cmd)) == 0 ]; then
echo "Yes"
else
echo "No"
fi
but i got the following erros:
main.bash: line 7: my_cmd: command not found
main.bash: line 7: [: ==: unary operator expected
No
I don't sure how can i fix this issue by using the command via string variable. I know that in this way it's working: if [ $(echo -n 0) == 0 ];
but I want to do it with variable the save the command.