格拉德尔';退出';在shell脚本中

格拉德尔';退出';在shell脚本中,shell,gradle,pipe,sh,cat,Shell,Gradle,Pipe,Sh,Cat,我想使用脚本构建Gradle(3.2.1)的包 脚本(hoge.sh)是 /hoge.sh工作并打印“hello” 但是,cat hoge.sh |/bin/sh-s在gradle build处停止。 构建看起来很成功,但过程从不打印“hello” 如何将hoge.sh修复为通过cat hoge.sh |/bin/sh-s正确运行 如果我运行cat hoge.sh |/bin/sh-I,它将返回 sh-4.2$ #!/bin/sh sh-4.2$ gradle build ###gradle i

我想使用脚本构建Gradle(3.2.1)的包

脚本(
hoge.sh
)是

/hoge.sh
工作并打印“hello”

但是,
cat hoge.sh |/bin/sh-s
gradle build
处停止。 构建看起来很成功,但过程从不打印“hello”

如何将
hoge.sh
修复为通过
cat hoge.sh |/bin/sh-s
正确运行

如果我运行
cat hoge.sh |/bin/sh-I
,它将返回

sh-4.2$ #!/bin/sh
sh-4.2$ gradle build
###gradle information###
sh-4.2$ exit
有关信息,请使用Gradle 2.1,最后会出现
退出
(在
回显“hello”
之后)

我怎样才能避免Gradle退出,让
回音“hello”
存活下来?

向第二行添加内容
gradle build
?或者转到
cat hoge.sh |/bin/sh

/gradlew build
之前运行
/gradlew
的目的是什么?为什么不立即调用构建呢?我认为
/gradlew
适合那些没有gradle环境的人,这就是安装。即使我使用
/gradlew build
,它的退出也会完成脚本…(我也想在
/gradlew build
之后添加一些行)无论如何,为了澄清,我修改了我的问题。非常感谢。
sh-4.2$ #!/bin/sh
sh-4.2$ gradle build
###gradle information###
sh-4.2$ exit
sh-4.2$ #!/bin/sh
sh-4.2$ gradle build
###gradle information###
sh-4.2$ echo "hello"
hello
sh-4.2$ exit