我正在查看具有以下 shebang 行的 tcsh 脚本:
#!/bin/tcsh -fb
# then executes some commands
-b 有什么作用?
来自手册页:
-b Forces a ''break'' from option processing, causing any further shell arguments to be treated as non-option arguments. The remaining arguments will not be inter- preted as shell options. This may be used to pass options to a shell script with- out confusion or possible subterfuge. The shell will not run a set-user ID script without this option.
但是我真的不明白这是什么意思...
一个例子会很棒。
谢谢。
最佳答案
例如,您有一个名为 --help
的脚本,并且您想使用 tcsh
执行它:
tcsh --help
这显然行不通。 -b
强制 tcsh
停止寻找参数并将命令行的其余部分视为文件名或脚本参数。所以,要运行上面奇怪命名的脚本,你可以这样做
tcsh -b --help
关于linux - -b 参数在 csh 中有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10207736/