How to generate JSON with random password with pwgen and bash
This script will generate a random password stored in a JSON file:
echo "{\"secret\": \"$(pwgen 30 1)\"}" > secret.json
Example output
{"secret": "thie2uv6Ro3cah2oodohx2vai5Ahka"}
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow