如何在 Linux 文件中的特定模式后添加值
我运行一个脚本,该脚本将值存储在如下变量中:
secret=`aws secretsmanager get-secret-value --secret-id <secretid> --region eu-west-1|grep SecretString|awk -F\" '{print $4}'`
现在我有一个名为 env-list
的文件,其中包含如下条目:
secret=
我想将第一个命令的输出重定向到在 < 之后粘贴code>= 登录 env-list
文件,以便我的 env-file
保存第一个命令中的秘密值:secret=value.
我对此很挣扎。
I run a script which stores a value in a variable like this:
secret=`aws secretsmanager get-secret-value --secret-id <secretid> --region eu-west-1|grep SecretString|awk -F\" '{print $4}'`
Now I have a file called env-list
which has an entry like this:
secret=
I want to redirect the output of first command to paste after =
sign in env-list
file, so that my env-file
holds the secret value from first command: secret=value
.
I am struggling a lot with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)