checkbashisms 命令不起作用

checkbashisms command not working

我正在尝试使用 checkbashisms in the process of converting bash scripts to meet the POSIX shell specification。 我是运行以下命令:

$checkbashisms test.sh
$

其中test.sh如下:

$ cat test.sh
#!/bin/sh
VAR=foo
if [ $VAR == bar ]; then
    echo 'bar!'
fi

如您所见,我没有得到任何结果。我不确定我做错了什么,但 AFAIK == 应该被识别为 bashism 并且应该将警告打印到标准输出(在本例中为命令行)。

知道为什么我没有收到任何关于此 bashism 的警告吗?

我必须解决这个问题。正如@Etan Reisner 在这里所建议的那样,我提取了 checkbashisms 文件并在我常用的 CentOS linux 上执行它。它按预期工作 - 我收到了关于“==”的警告。