在php的一个函数中有下面这么一句
$cmd=$hive -e "alter table $table drop partition ($partition_clause);";
commandRun($cmd,$dir,$stdout=false,$verifyRet=true,$run);
其中在commandRun函数中又调用了system函数,
 system("$cmd >> $dir/process 2>&1",$ret);
当在执行时,总是在$cmd=$hive -e "alter table $table drop partition ($partition_clause);";
这一句报错:PHP Parse error:  syntax error, unexpected '"' in /home/taobao/dataqa/framework/data.base.php on line 276。
后来我把$cmd=一句改成
$cmd=<<<EOT
$hive -e "alter table $table drop partition ($partition_clause);"
EOT;
 就没报错,我不知道这是为什么。
$hive -e "alter table $table drop partition ($partition_clause);"这句直接在linux环境下是可以执行的啊,怎么就引号错误了呢