I have a file which contains shell test statements.
I need to evaluate the expression. For example:
a="something"
fromfile='[ "$a" == "something" ]'
if `$fromfile`; then
echo "true"
else
echo "false"
fi
It always throws false. I tried with `` and eval, but still not works.
What is the solution?
Aucun commentaire:
Enregistrer un commentaire