chenall/grub4dos

grub4dos对变量名有什么要求吗?

daiaji opened this issue · 5 comments

图片
uuid打不全
变量名长度有限制吗?
内存限制所以只有8个字符?

a1ive commented

新的版本支持变量,用法和MSDOS一样。
关键命令:
set [/p] [/a|/A] [/l|/u] [VARIABLE=[STRING]]
variable 指定环境变量名(最长8个字符)。
string 指定要指派给变量的一系列字符串(最长512个字符)。
不带参数的 SET命令会显示当前变量。
要删除某个变量,只需要让=后面为空就可以
set myvar=
将会删除变量myvar
显示已使用的名称的所有变量的值。例如:
set ex_
会显示所有以ex_开头的变量,如果没有任何匹配返回0.

set [/p] [/a|/A] [/l|/u] [VARIABLE=[STRING]]
variable 指定环境变量名(最长8个字符)。
string 指定要指派给变量的一系列字符串(最长512个字符)。

难顶,历史包袱太重了。

It is for compatibility with older grub4dos.
Behaviour is correct.
Otherwise older grub4dos batch files may fail.

It is for compatibility with older grub4dos. Behaviour is correct. Otherwise older grub4dos batch files may fail.

But old scripts must never use variable names longer than eight characters (wasn't that a limitation all along?), and I don't think the compatibility makes any sense.

Older grub4dos had same behaviour, you could use 9 character variables without error.