Je voudrais exécuter une commande composée de plusieurs "morceaux".
php="php"
options="-l"
for f in `git diff-index --cached --name-only HEAD | grep -e '\(php\|phtml\)$'`; do
if [ -f $f ]; then
# Here I want to run my command defined
# in $php and $options and put the result in
# $php_lint var
# like this command would do:
# php_lint=$(php -l $f)
# but with something like that:
# php_lint=eval $php $options $f
fi
done
Comment puis-je le faire ?
Mise à jour :
Après avoir lutté sur un point particulier, j'ai posé cette question :
Jetez-y un coup d'œil, cela pourrait aussi vous aider.