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-editAny ideas?
1 Answer
If the utility only wants a password multiple times use this:
yes 'password' | prlctl set "VM" --password-to-edityes is just prints the string repeatedly until killed.