I wonder how to create a channel
program 1 | ... | program N
where several programs request user input. The problem is that | launches programs in parallel and, thus, starts reading from the terminal in parallel.
For such cases, it would be useful to have a pipe | , which starts the program (i + 1) only after the program I produced some output.
Edit:
Example:
cat /dev/sda | bzip2 | gpg -c | ssh user@host 'cat > backup'
Here both gpg -c and ssh request a password.
The workaround for this particular example would be to create ssh key pairs, but this is not possible for each system, and I was wondering if there was a common solution. Gpg also allows you to pass a passphrase as a command line argument, but this is not recommended for security reasons.
source share