#! /bin/bash
sh-cmd1
....
sh-cmdn
##################
expect <<\EOF
expect-cmd1
.......
expect-cmdn
EOF
##################
sh-cmdo
.......
sh-cmdp
##################
expect <<\EOF
expect-cmdr
.......
expect-cmds
EOF
##################
................
转载于:https://blog.51cto.com/lielie/1533636