Handle multiple Spawn process in expect script
问题 Here is my use case for expect script ( one of few i have) I want to run multiple sed command over ssh. Its like pre-build environment setup. I want to run something like this :- #!/usr/bin/expect set timeout -1 spawn -noecho bash -c "ssh -t user@host 'sed -i <some_stuff1> <file1>'" spawn -noecho bash -c "ssh -t user@host 'sed -i <some_stuff2> <file2>'" spawn -noecho bash -c "ssh -t user@host 'sed -i <some_stuff3> <file3>'" expect { -re ".*sword.*" { exp_send "$env(PASS_WORD)\n" exp_continue