frostfs-dev-env/bin/passwd.exp
anastasia prasolova d0094d8068 #70 automating password input to neo-go commands
Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
2021-06-02 19:06:56 +03:00

17 lines
269 B
Text
Executable file

#!/usr/bin/expect
set passwd [lindex $argv 0]
set args [lrange $argv 1 end]
spawn -noecho {*}$args
expect -re {^.*assword.*$}
if { $passwd == "-"} {
send -- "\r"
} else {
send -- "$passwd\r"
}
expect EOF
lassign [wait] pid spawnid os_error_flag value
exit $value