我已经创建了一个使用脚本操作的Oozie工作流。它调用的脚本有两个强制参数和几个可选参数。在Oozie工作流中处理可选参数的正确方式是什么?
oozie job -config job.properties -run -DMandatory1 a -DMandatory2 b -DOptional1 c
我不能列出工作流XML中的参数(Optional2、Optional3等),因为Oozie会错误地声明参数不存在。在调用允许每个选项的Oozie脚本之前,我是否需要创建多个工作流并创建一些逻辑?
我试图编写一个小脚本来列出一个给定变量的目录。但是,在将我的输入读入变量ls之后,我根本无法运行PATH。
#!/system/bin/sh
echo "enter directory for listing"
read "PATH"
ls "$PATH" -R > list.txt
此出口有:
ls: not found
...and没有写任何东西给list.txt。
这里我有一个脚本,它导出一些必要的路径在Linux中。运行此脚本后,我必须运行一些其他脚本。
我有两个脚本
1 import.sh = importing paths
2 main.sh = this script do something with HCI (use for Bluetooth purpose).
当我运行./import.sh,然后运行./main.sh时,它就会给出错误。当我运行. ./import.sh,然后运行./main.sh时,它工作得很好。
那么./import.sh和. ./import.sh之间的区别是什么呢
如果我以超级用户身份运行脚本,会发生什么
我最近刚开始对scala进行编程,在“scala中的编程”(www.artima.com/pins1ed)一书中,介绍了在linux中执行scala脚本的以下方法:
#!/bin/sh
exec scala "$0" "$@"
!#
// Say hello to the first argument
println("Hello, "+ args(0) +"!")
现在我已经使用linux很长时间了,但是bash脚本不是我的专长。现在我可以猜到这种scrpt是如何工作的(而且它运行得很好),但是我想知道!#和$@到底做了什么。
我想知道有什么机制可以用来从子shell中更改父shell的目录。对于ex.,我正在运行脚本"settings.sh",在我的$HOME中。$HOME有一个目录$HOME/TEST/run。如果"settings.sh"脚本如下所示
#!/bin/bash
# some shell related code
# some shell related code
cd $HOME/TEST/run
exit 0
我在$HOME命令提示符下执行上面的脚本。执行之后,我希望命令提示符位于目录$HOME/TEST/run中。我