I would like to run a command made of several "pieces".
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
How can I do this?
Update:
After struggle on a particular point, I asked this question :
Please have a look, it could also help you.