I want to run sshd restart
on Linux and Solaris machines via expect
. ( my expect runs in my ksh script )
I created an expect script. When expect sees a prompt "#" it runs sshd restart
.
I also run the same script on Solaris with a prompt ">". How to create one expect line that supports both prompts?
on Linux
expect # {send "/etc/init.d/sshd restart\r"}
on Solaris
expect > {send "/etc/init.d/sshd restart\r"}