I'm trying to run the command

cat ./password | sudo -Skp '' yum install git

and it goes through the motion and finally gets to the last line where it returns

Is this ok [y/N]: Operation aborted.

For some reason it is automatically canceling the install before any user input, I could probably look into yum options for a do not prompt but the command will likely change in the future. So I'm really hoping to get sudo, who I suspect is the culprit in canceling the install to play nicely with whatever command it is given after being authenticated from stdin.

Edit ---

To be clear yum in this example is an arbitrary command, it could be any interactive command and I'm hoping to make any such interactive command wait for the users input rather then close immediately.

  • 2
    Add -y to yum command. yum install -y git. – Paulo Tomé Jan 13 at 22:11
  • Thanks for the suggestion, but yum might change in the future so I'm hoping to make sudo work with whatever the interactive command may be – Exting123 Jan 13 at 22:14
  • 2
    Using the suggested -y is likely the most future-proof means to handle this. – steve Jan 13 at 22:43
  • What I mean is that yum might change to a different command, for arbitrary example cat ./pass | sudo -Skp '' read will instantly return rather than waiting for user input – Exting123 Jan 13 at 23:20
  • 1
    Why don't you just configure sudo so that it doesn't ask for a password? – roaima Jan 13 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.