So you'll need to run your command in a process that has no controlling terminal. "cron" and "at" will does this, and you might also have luck playing with "expect" (although I haven't tried it.)
Unfortunately, when I ran your example command from "at", it gave the following error:
tarsnap-keymgmt: Cannot set terminal settings: Input/output error tarsnap-keymgmt: Error reading password and that's as far as I got. Chris On 10/28/25 09:46, Rihad wrote:
Hi, I need to create a passphrased key in a shell script, and while testing it in a console it's still asking for the passphrase. Any way to do that easily?$ echo -e "MyStrongPassword\nMyStrongPassword" | tarsnap-keymgmt -- outkeyfile outkeyfile -w -r -d --nuke --passphrased keyfilePlease enter passphrase for keyfile encryption: