expr为4个字符(t,n,f,y)提供意外结果.如果你正在做进一步的计算.然后代码就破了.我不明白为什么会这样?
% expr (F)
F
% expr (F)*1
can't use non-numeric string as operand of "*"
Run Code Online (Sandbox Code Playgroud)
和,
% expr (t)
t
% expr (n)
n
% expr (f)
f
% expr (y)
y
Run Code Online (Sandbox Code Playgroud)
这是charcters的文件:t,n,f,y.没有这些字符命名的变量.它应标记未找到的变量或其他一些有效错误.我错过了什么吗?
The [expr] conditions of commands such as [if] and [while] expect the expression to evaluate to a boolean, i.e., an integer or one of the following string values:
true, on, yes
false, off, no
Run Code Online (Sandbox Code Playgroud)
我相信t,y,f和n是这些的捷径.