2019年7月10日 星期三

UEFI IndexVar in for loop

英文果然不是我的菜,一直卡在 IndexVar 怎麼命名都不對的情況!

查了一下 Code,發現 Code 只允許一個字元!


靜一下心,再把文字說明看一下,原來 IndexVar 只允許一個字元,真不知道是那個人想出來的,都不能使用有意義的變數名稱。

If after expansion no such files are found, the literal string itself is kept. Indexvar is any alphabet character from ‘a’ to ‘z’ or ‘A’ to ‘Z’, and they are case sensitive. It should not be a digit (0-9) because %digit will be interpreted as a positional argument on the command line that launches the script. The namespace for index variables is separate from that for environment variables, so if indexvar has the same name as an existing environment variable, the environment variable will remain unchanged by the for loop.

沒有留言:

張貼留言