Pipe string to a command with multiple read prompts

How can I pipe a string to a command with multiple read prompts in OS X?

I am running a command for a Parallels VM to enable a password which prompts for multiple values (without running a secondary command).

Ex:

$ prlctl set "VM" --password-to-edit
Please enter a new password:
Please verify password:

I would like to pipe the password string to both read prompts. I have tried the following but the string is not passed to the second read prompt.

echo 'password' | prlctl set "VM" --password-to-edit

Any ideas?

1 Answer

If the utility only wants a password multiple times use this:

yes 'password' | prlctl set "VM" --password-to-edit

yes is just prints the string repeatedly until killed.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like