Pipedwsadmin
は、フロー制御を使用してスクリプトを実行できません。そのモードでは、改行がコマンドを区切るためです。
set numbers {1 3 5 7 11 13}
foreach num $numbers {
puts $num
}
出力:
[wasuser@oktest-prod-app-2 ~]$ ${WC_WSADMIN:?} -f test.jacl
WASX7209I: Connected to process "dmgr" on node EmProdDmgrNode using SOAP connector; The type of process is: DeploymentManager
1
3
5
7
11
13
[wasuser@oktest-prod-app-2 ~]$ ${WC_WSADMIN:?} <test.jacl
WASX7209I: Connected to process "dmgr" on node EmProdDmgrNode using SOAP connector; The type of process is: DeploymentManager
WASX7029I: For help, enter: "$Help help"
wsadmin>1 3 5 7 11 13
wsadmin>WASX7015E: Exception running command: "foreach num $numbers {"; exception information:
com.ibm.bsf.BSFException: error while eval'ing Jacl expression:
wsadmin>WASX7015E: Exception running command: "puts $num"; exception information:
com.ibm.bsf.BSFException: error while eval'ing Jacl expression:
can't read "num": no such variable
while executing
"puts $num"
wsadmin>WASX7015E: Exception running command: "}"; exception information:
com.ibm.bsf.BSFException: error while eval'ing Jacl expression:
invalid command name "}"
while executing
"}"
私のスクリプトが生成されます。一時ファイルに保存する以外に回避策はありますか? 私はこれを行うことが可能であることを知っています:
foreach num $numbers { puts $num }
しかし、ブロックに複数のコマンドが必要な場合はどうなるでしょうか?