Guest User

Untitled

a guest
Jul 7th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #!/usr/local/bin/expect --
  2. # Input: username password
  3. set USER [lindex $argv 0]
  4. set PASS [lindex $argv 1]
  5.  
  6. if { $USER == "" || $PASS == "" } {
  7. puts "Usage: ./scriptname username password\n"
  8. exit 1
  9. }
  10.  
  11. spawn passwd $USER
  12. expect "assword:"
  13. send "$PASS\r"
  14. expect "assword:"
  15. send "$PASS\r"
  16. expect eof
Add Comment
Please, Sign In to add comment