- 论坛徽章:
- 0
|
本帖最后由 unixthisyear 于 2012-07-13 14:46 编辑
- if ( "$Server_type" eq "master" ){
- #print $Path_to_install_command;
- $install = Expect->spawn( $Path_to_install_command ) or die "Couldn't spawn, $!";
-
- $install->expect(600, # set timeout
- [ qr/Do you wish to continue?/,
- sub { my $self = shift; $self->send("y\r"); exp_continue;} ],
- ....
- ....
- [ qr/That file can be deleted after you are sure the install was successful./,
- sub { my $self = shift; $self->send("\r"); exp_continue;} ],
- );
- $install->soft_close();
- exit 0;
- }
复制代码 手动安装时,执行到最后一步,按回车程序就正常退出了,回到shell提示符。
但是用这个脚本安装时,到最后一步会停住,每次都是手动ctrl+c去退出。 |
|