我怎样才能获得php结果并在bash中使用它?

dan*_*car 2 php bash

我有一个输出0或1的php文件.如何在bash中使用它作为条件?

Dan*_*eck 5

#!/bin/bash
result=$( php script.php )
if [ "$result" = "0" ] ; then
    # do stuff
else 
    # do other stuff
fi
Run Code Online (Sandbox Code Playgroud)

不确定如何调用PHP(参数等)