我有一个输出 0 或 1 的 php 文件。 我如何在 bash 中使用它作为条件?
最佳答案
#!/bin/bash
result=$( php script.php )
if [ "$result" = "0" ] ; then
# do stuff
else
# do other stuff
fi
不确定 PHP 是如何调用的(参数等)
关于bash - 如何获取 php 结果并在 bash 中使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5501128/