如何使用 pwgen 和 bash 生成带随机密码的 JSON
此脚本将生成存储在 JSON 文件中的随机密码:
generate_secret_json.sh
echo "{\"secret\": \"$(pwgen 30 1)\"}" > secret.json示例输出
secret.json
{"secret": "thie2uv6Ro3cah2oodohx2vai5Ahka"}Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow