Let’s say you want to spawn a shell, wait for the shell prompt, and then send the commandwhoami: expect -c 'spawn /bin/bash; expect "$ "; send "whoami\n"' First,spawn /bin/bashinitiates a new shell instance. Then, theexpect "$ "waits for the shell to present its typical promp...