我想在Uno-Choice动态参考参数中调用
shell脚本
并执行一些操作(创建一些文件并调用其他一些shell
来自被调用shell脚本的脚本).
截至目前,我能够调用shell脚本并捕获一些文件,但我无法做到
创建新文件或从中调用另一个shell脚本.
def sout = new StringBuffer(), serr = new StringBuffer()
// 1)
def proc ='cat /home/path/to/file'.execute()
//display contents of file
// 2)
def proc="sh /home/path/to/shell/script.sh".execute()
//to call a shell script but the above dosent work if I echo some contents
//into some file.
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
return sout.tokenize()
例如: – 如果我添加行,则在script.sh中
echo "hello world" > test
然后没有创建测试文件
为了更多的理解: