您需要将变量作为参数传递给Shell脚本,并且Shell脚本必须读取其参数。
因此在PHP中:
$useraddress = escapeshellarg('mytestuser@tpccmedia.com');$upassword = escapeshellarg('test1234');$addr = shell_exec("sudo /home/tpccmedia/cgi-bin/member_add_postfixadmin $useraddress $upassword 2>&1");在shell脚本中:
useraddress=$1upassword=$2



