Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在csh中-b参数做什么?_Linux_Shell_Csh_Tcsh - Fatal编程技术网

Linux 在csh中-b参数做什么?

Linux 在csh中-b参数做什么?,linux,shell,csh,tcsh,Linux,Shell,Csh,Tcsh,我正在看一个具有以下shebang行的tcsh脚本: #!/bin/tcsh -fb # then executes some commands b是做什么的 从手册页: -b强制“中断”选项处理,导致任何进一步的shell参数 被视为非选项参数。其余的参数将不相互关联- 被称为shell选项。这可用于将选项传递给具有- 排除混乱或可能的诡计。shell不会运行设置用户ID脚本 没有这个选项 但我真的不明白这意味着什么 举个例子就好了 谢谢。例如,您有一个名为--help的脚本,您想使用tc

我正在看一个具有以下shebang行的tcsh脚本:

#!/bin/tcsh -fb

# then executes some commands
b是做什么的

从手册页:

-b强制“中断”选项处理,导致任何进一步的shell参数 被视为非选项参数。其余的参数将不相互关联- 被称为shell选项。这可用于将选项传递给具有- 排除混乱或可能的诡计。shell不会运行设置用户ID脚本 没有这个选项

但我真的不明白这意味着什么

举个例子就好了


谢谢。

例如,您有一个名为
--help
的脚本,您想使用
tcsh
执行它:

tcsh --help
这显然行不通。
-b
强制
tcsh
停止查找参数,并将命令行的其余部分视为脚本的文件名或参数。因此,要运行上述命名奇怪的脚本,您可以

tcsh -b --help

事实上,在这个回答中使用的场景中,舍邦线并没有起作用如果您的命名精巧的脚本是可执行的,并且仅通过“-help”调用,那么只有shebang选项起作用并使其工作。(事实上,我很惊讶它会……)。