* On 21 Apr 2016, Xu Wang wrote:
> Hi,
>
> I would like to have a print command that takes input from the user.
> But mutt pipes the message to the print command so I guess I cannot
> use something like
> read -p "where to save?" filename
>
> because read looks on STDIN and mutt already piped to STDIN.
You've analyzed it right. Solution: read </dev/tty
#!/bin/bash
## WARNING UNCHECKED INPUT
## JUST A PROOF OF CONCEPT
read -p 'Save to: ' fn </dev/tty
cat >"$fn"
--
David Champion • [email protected]