I'm writing a shell script to set a VNC password using vncpasswd.
The only way to use vncpasswd is in interactive mode (enter password, return, confirm password, return).
How can I respond to the prompts in my shell script so I can set the password automatically? (i.e. non-interactive).
Best How To :
If the program is reading from your terminal instead of stdin, you'll find that it ignores any data you send in using file redirection. If that's the case, then you can use a program like expect to automate interactions with the terminal using a pseudy-tty. This is exactly the sort of problem it was designed to solve.