- 论坛徽章:
- 0
|
我在写一个fml安装程序的shell程序中,使用了expect,由于fml安装过程中需要手动输入的参数,在程序中无法控制出现的时间,所以导致每次初始化的时候有一些参数不能正确的设定,所以想请大家帮忙看一下如何控制expect程序运行的时间。
-------------------------------------------------
我把代码发一下,还有运行的结果,我打印到一个临时文件中了:
$dir是用户所在路径,$name是fml管理者的名称
/usr/local/bin/expect << EOF
spawn $dir/fml/makefml config $name
expect "]"
expect "]"
expect "]"
expect "]"
send "1\r"
expect "]"
expect "]"
expect "]"
send "1\r"
expect "]"
expect "]"
send "$member\r"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
expect "]"
expect "]"
send "5\r"
expect "]"
expect "]"
expect "]"
expect "]"
send "1\r"
expect "]"
expect "]"
expect "]"
expect "]"
expect "]"
send "3\r"
expect "]"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
expect "]"
expect "]"
send "2\r"
expect "]"
expect "]"
send "5\r"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
send "\r"
expect "]"
expect "]"
expect "]"
EOF
运行结果的一部分:
************************************************************
SUBJECT TAG TYPE (0-11) [0] 3----------------------〉总是出现问题的参数部分
[H[2J ************************************************************
<<< makefml --- FML Configuration Interface --- >>>
SUBJECT_TAG_TYPE [:]
0 END
TYPE Subject Example
----------------------------
1 Subject: NO TAG (Default, Fml recommends)
2 Subject: (Elena:00100)
3 Subject: [Elena] (hml 1.6 compat)
4 Subject: (Elena 00100)
5 Subject: [Elena 00100]
6 Subject: (Elena,00100)
7 Subject: [Elena,00100]
8 Subject: (Elena)
9 Subject: [Elena]
10 Subject: (00100)
11 Subject: [00100]
************************************************************
SUBJECT TAG TYPE (0-11) [0]
2----------------------〉总是出现问题的参数部分,没有出现在正确的位置
5----------------------〉总是出现问题的参数部分,没有出现在正确的位置
[H[2J ************************************************************
<<< makefml --- FML Configuration Interface --- >>>
0 END
* Subject: TAG
1 SUBJECT_TAG_TYPE [:]
2 SUBJECT_TAG_FIGURE 5
* To:
3 REWRITE_TO To: is original (pass through)
* Date:
4 DATE_TYPE original-date
5 PASS_ALL_FIELDS YES
6 PASS_RECEIVED_THROUGH YES
************************************************************
which type (0-6) [0]------------------〉5应该出现在这里,在程序中如何添加等待的时间也不行
[H[2J ************************************************************
<<< makefml --- FML Configuration Interface --- >>>
@SUBJECT_FORM_LONG_ID FIGURES of Subject TAG
for all $SUBJECT_TAG_TYPE e.g. [elena 00100] for 5 figures.
The current figure is 5.
0 END
1 -1 e.g. [elena 1], [elena 100], [elena 10000]
2 2 e.g. [elena 01], [elena 100], [elena 10000]
3 3 e.g. [elena 001], [elena 100], [elena 10000]
4 4 e.g. [elena 0001], [elena 0100], [elena 10000]
5 5 e.g. [elena 00001], [elena 00100], [elena 10000]
6 6 e.g. [elena 000100]
7 7 e.g. [elena 0000100]
8 8 e.g. [elena 00000100]
9 9 e.g. [elena 000000100]
10 10 e.g. [elena 0000000100]
----The end---- |
|