2
  1. yes mypassword |  while true; do sudo -S sleep 3; sudo -k; done
    

    can supply multiple identical stdin inputs mypassword to the while loop.

  2. 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
    
  3. More generally, if I know a command expects a number of different stdin inputs, how can I pipe the stdin inputs to it?

Thanks.

Tim
  • 101,790

0 Answers0