【发布时间】:2018-11-18 16:37:39
【问题描述】:
我需要设置一个作为命令传递的变量。
例如,命令是这样的:
github "Init command"
我必须执行的命令是这样的:
git add. && git commit -m "/TItle" && git push origin master
"Init command" 是 "/Title"
【问题讨论】:
标签: windows batch-file variables cmd
我需要设置一个作为命令传递的变量。
例如,命令是这样的:
github "Init command"
我必须执行的命令是这样的:
git add. && git commit -m "/TItle" && git push origin master
"Init command" 是 "/Title"
【问题讨论】:
标签: windows batch-file variables cmd
恕我直言,最简单的方法是创建一个函数:
github() {
# $1 is the (1st) parameter passed to the function
git add . && git commit -m "$1" && git push origin master
}
【讨论】: