【发布时间】:2016-03-11 03:48:25
【问题描述】:
在下面的代码中,我需要在第一个 if 语句中使用 return 关键字。我需要在 echo.b 之后退出函数
push() {
a=$1
b=$2
if [ $# -eq 0 ]
then
echo "Enter git shortname for first argument"
fi
if [ $# -eq 1 ]
then
b=$(timestamp)
fi
git add -A .
git commit -m $b
git push $a
echo "push() completed."
}
研究
谷歌拉起SO article
【问题讨论】: