我试图来回传递参数,从shell传递到PHP,然后再传递一次。在我的简单测试中,我可以轻松地从shell转到PHP,但是没有办法把字符串拿回来。我试过逃避和逃避,但都没有效果。
壳
#!/bin/sh
# set a date and time variables, in the form of YYYY-MM-DD and HH:MM:SS
dateVar=`date +%Y-%m-%d`
timeVar=`date +%H_%M`
# Launching PHP
runPHP=`which php`
$runPHP calledPHP.php $timeVar $dateVar
#