How to automate generation of htpasswd from command line without typing password?

.htpasswd, bash

Solution

Why not just use:

htpasswd -b -c ~/temp/password admin test101

Problem

I am trying to automate creating a password from the command line. I have tried the below but it still keeps asking for the password. ``` echo "test101" | htpasswd -c ~/temp/password admin ``` How to generate automate `htpasswd` from command line without typing password?

Original source