yes mypassword | while true; do sudo -S sleep 3; sudo -k; done
can supply multiple identical stdin inputs
mypassword
to the while loop.When both
sudo -S
and the command it executes need different stdin input, is there any way to provide their stdin inputs?<how can I supply password to sudo and "hello" to cat respectively> | sudo -S cat
More generally, if I know a command expects a number of different stdin inputs, how can I pipe the stdin inputs to it?
Thanks.