我尝试将PHP代码保存在一个变量中,以便在PHP文件中写入。但它不适用于bash脚本中的其他变量。
AUTO_CONFIG='<?php $AUTOCONFIG = array(
"dbtype" => "mysql",
"dbname" => '$DIR_NAME',
"dbuser" => "root",
"dbpass" => "hallo123",
"dbhost" => "localhost",
"dbtableprefix" => "",
"adminlogin" => "root",
"adminpass" => "root",
"directory" => "var/www/'$DIR_NAME'/nextcloud/data ",
);'
$DIR_NAME
是bash脚本中的变量。 (字符串)