0

I am installating tightvnc server on my ubuntu machine by using ruby script my script contain following:

#!/usr/bin/ruby env    
`sudo apt-get --force-yes -y install tightvncserver`
`printf "%s\n%s\n" "demo123" "demo123" | vncserver :1`

I used printf way because vncserver ask for password on terminal, But that way failed, Is their any better way to solve this?

I wants to provide password using ruby script so that terminal not prompt and ask user to provide password.Hope this clear

Pradeep Gupta
  • 387
  • 2
  • 5
  • 18

1 Answers1

1

Per my comment the stackoverflow post, have a look at expect, there are several examples kicking around.

arober11
  • 426
  • 3
  • 7