I have the following expect statement within my bash script:
/usr/bin/expect << EOF
spawn -noecho lucli users add -username user -role admin -email
[email protected]
expect "password:" { send "password\n" }
expect "password:" { send "password\n" }
expect eof
EOF
I want the expect script to validate that the correct output is returned from the CLI command after it passes the passwords and creates the user.
The message I want to validate that gets returned is "added to the system successfully"
I can't figure out how to do that from within the bash script using expect.
Can anyone help?
expecthere at all, rather than passing a pre-crypted copy of the password on the command line? Expect isn't part of bash -- it's a completely separate programming language derived from TCL, and is otherwise a big hammer to pull in.