[英]In symfony, how to change the value of the variable in .env file?
In symfony, I am writing bash script for deployment. 在symfony中,我正在编写bash脚本以进行部署。 For that, I want to change variable's value in .env file from bash script.
为此,我想从bash脚本更改.env文件中的变量值。 My
.env
file has variable as: APP_DISABLED=true
. 我的
.env
文件的变量为: APP_DISABLED=true
。
In bash script I want to change it as APP_DISABLED=false
. 在bash脚本中,我想将其更改为
APP_DISABLED=false
。
I don't know how can I edit .env
file and update the value from bash script. 我不知道如何编辑
.env
文件并从bash脚本更新值。
Please guide me. 请指导我。
将此行添加到您的bash脚本中:
sed -i "s/^APP_DISABLED=true/APP_DISABLED=false/" /path/to/.env/file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.