title: Problem generating public and private keys with password via openssl without shell interaction
body: <p>Problem:</p>
  <p>Generate pair private &amp; public keys with input onetime</p>
  <p>My attempt (files are not created):</p>
  <pre><code>#!/bin/bash
  
  read -p &quot;Please input secret: &quot; secret
  
  mkdir -p ./src/app-for-purchasing-service/config/jwt
  
  openssl genrsa -passout pass:&quot;$secret&quot; -aes256 -out ./src/app-for-purchasing-service/config/jwt/new-private.pem 4096
  openssl rsa -pubout -in ./src/app-for-purchasing-service/config/jwt/new-private.pem -passin pass:$secret ./src/app-for-purchasing-service/config/jwt/new-public.pem -passout pass:$secret
  echo $secret &gt;&gt; ./src/app-for-purchasing-service/.env
  </code></pre>