Created
October 4, 2017 15:33
-
-
Save emhaye/48933e2b400f3674e6ef6c56338275f7 to your computer and use it in GitHub Desktop.
Revisions
-
emhaye created this gist
Oct 4, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ Expect auto task to enter password example: my password `bojong dev` ``` #!/usr/bin/expect -f set force_conservative 0 ;# set to 1 to force conservative mode even if ;# script wasn’t run conservatively originally if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg} { sleep .1 exp_send -s -- $arg } } set timeout -1 spawn sudo apt update expect -exact ": " send -- "bojong dev\r" expect eof ```