我想在我的腳本中有大量的選項。用戶將輸入只能匹配其中一個選項的輸入。我希望能夠有多個不同的選項運行相同的命令,但我似乎無法得到ORs的工作。以下是我認爲它應該是什麼樣子,關於如何使a或b行工作的任何想法?如何在tcl switch語句中使用或?
switch -glob -- $opt {
"a" || "b" {
puts "you selected a or b, probably not both"
}
default {
puts "Your choice did not match anything"
}
}
謝謝,這正是我需要知道的。 – SuperTetelman 2013-03-05 18:40:45