linux - 用 bash 解析 .env 文件

标签 linux bash shell environment-variables

<分区>

我有 .env 文件,我正在尝试从中解析值。

我运行了这个

cat.env | grep 端口=

我得到了

PORT=3333

如何获取特定键的值?

最佳答案

cat env | grep PORT= | cut -d '=' -f2

关于linux - 用 bash 解析 .env 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50107329/

相关文章:

bash - 将 SSH 流作为 Perl 脚本输入而不是物理文件

bash - 超时执行持续时间而不是命令

bash - 使用正确的语法运行Bash脚本,但它不断给我带来语法错误

c - 退出函数后出现段错误

c++ - 从 OpenGL 应用程序中提取颜色/深度缓冲区

linux - 在 Linux 终端中更改 DIR 颜色

Php函数通过Kannel发送短信

linux - Linux : how to get info on opened files? 上的核心转储文件

bash - Linux : Search for coincidences in four different files

php - 2>&1 和日志文件同时进行