I'm using here-documents in a bash script to automate installation and setup where a password is required many times. I enter the password once and the script passes it to the various commands. In most instances the here-document approach handles this fine. However, in one case I get this error:
Enter VNC password: stty: standard input: Inappropriate ioctl for device
Verify password:
stty: standard input: Inappropriate ioctl for device
Please notice that this error message is from x11vnc -storepassword
(not from sudo
.)
My problem is related to x11vnc -storepasswd
and here's my code:
sudo x11vnc -storepasswd ~/.vnc/passwd << ENDDOC
password
password
y
ENDDOC
That obviously (from the error) does not work. I would appreciate a working example of how to implement sudo x11vnc -storepasswd ~/.vnc/passwd
in a script.
In case it helps, the prompts look like this:
Enter VNC password:
Verify password:
Write password to /home/user/.vnc/passwd? [y]/n n
Will using expect
be a better solution? If so, how would I use it in this case? (I have never used expect
before but I have looked at a lot of examples since posting this question and I cannot get expect
to work on my own.)
Password for brando9: stty: 'standard input': Inappropriate ioctl for device
, what does it mean?expect
?