- 论坛徽章:
- 0
|
本帖最后由 ouyangting_2000 于 2012-05-10 00:22 编辑
尝试在java启动的语句前加上了nohup,发现进程被神奇的启动了,但是expect脚本却报了一个超时的错误。
[root@newtest-tomcat1 bin]# /opt/script/ScriptJava/test.exp start-cps-atm.sh
expect version 5.42.1
argv[0] = /usr/bin/expect argv[1] = -d argv[2] = /opt/script/ScriptJava/test.exp argv[3] = start-cps-atm.sh
set argc 1
set argv0 "/opt/script/ScriptJava/test.exp"
set argv "start-cps-atm.sh"
executing commands from command file /opt/script/ScriptJava/test.exp
spawn ./start-cps-atm.sh
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {10898}
expect: does "" (spawn_id exp4) match glob pattern "*Please select:*"? no
Enviroments:
[0]: stage00
[1]: stage01
[2]: stage02
[3]: production
expect: does "Enviroments:\r\n[0]: stage00\r\n[1]: stage01\r\n[2]: stage02\r\n[3]: production\r\n" (spawn_id exp4) match glob pattern "*Please select:*"? no
Please select:
expect: does "Enviroments:\r\n[0]: stage00\r\n[1]: stage01\r\n[2]: stage02\r\n[3]: production\r\nPlease select: " (spawn_id exp4) match glob pattern "*Please select:*"? yes
expect: set expect_out(0,string) "Enviroments:\r\n[0]: stage00\r\n[1]: stage01\r\n[2]: stage02\r\n[3]: production\r\nPlease select: "
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "Enviroments:\r\n[0]: stage00\r\n[1]: stage01\r\n[2]: stage02\r\n[3]: production\r\nPlease select: "
send: sending "2\r" to { exp4 }
expect: does "" (spawn_id exp4) match glob pattern "EOF"? no
2
expect: does "2\r\n" (spawn_id exp4) match glob pattern "EOF"? no
env is stage02
expect: does "2\r\nenv is stage02\r\n" (spawn_id exp4) match glob pattern "EOF"? no
cp succesful
expect: does "2\r\nenv is stage02\r\ncp succesful\r\n" (spawn_id exp4) match glob pattern "EOF"? no
expect: timed out
[root@newtest-tomcat1 bin]#
|
|