【发布时间】:2015-10-29 02:29:49
【问题描述】:
在我的脚本中,我正在执行一些 git 命令,但我希望命令的输出在脚本运行时显示在屏幕上。
OS X Yosemite,如果这很重要的话。
#!/bin/sh
# get the Git command from parameter
if [ $# -eq 0 ];
then
echo "no arguments supplied"
exit 1
fi
cmd=$1
echo "doing some stuff"
# do some stuff (not echoed to screen)
echo "executing command"
# this is the command I want to echo output to screen
git $cmd
echo "doing some other"
# do other stuff (not echoed to screen)
【问题讨论】:
-
它应该会自动回显。
-
@ryanpcmcquen,你是对的。我使用的命令显然没有输出,所以我认为我做错了什么。直到。
-
没有输出是你习惯的,如果你足够使用命令行的话。哈哈。 ;^)
标签: bash osx-yosemite