function checkGitAnnex
{
echo "GIT ANNEX INFO:"
echo "`git annex version`"
annex_init=echo `cd $GIT_REPO git annex init`
if [[ $annex_init != *"ok"* ]]; then
echo "ERROR with git annex init!"
echo $annex_init
echo -e "\t- Error with git annex init." >> err_message.txt
else
echo "init ok!"
fi
}
但是这次执行给了我一个空值$ annex_init
P.S。正常执行命令:git annex is:
user@server156:~/some_project$ git annex init
init
pre-commit hook (../../some_project/.git/hooks/pre-commit) already exists, not configuring
ok