了解Bash脚本

时间:2016-12-14 14:53:22

标签: python bash

我是一个非常新的Bash世界。我正在一个项目中工作,我遇到了一个外部程序插件,他们有一个像这样的命令

bash -l -c "/usr/local/bin/python /opt/abc/abcd/test.py --user {username} --password {password} {inputFileLuid0} {prLuid}"

我无法理解-l和-c代表什么。我们还有两个目录位置。请帮助我。

1 个答案:

答案 0 :(得分:1)

从页面man bash

-l        Make bash act as if it had been invoked as a login shell (see INVOCATION below).
-c        If  the  -c  option  is  present,  then  commands  are read from the first non-option argument com‐
             mand_string.  If there are arguments after the command_string, they are assigned to the  positional
             parameters, starting with $0.

基本上-c参数之后的东西是bash代码,它将被执行。