Questions tagged «ksh»

3
为什么不允许数字函数名称?
考虑以下: $ ksh -c '1(){ echo hi;};1' ksh: 1: invalid function name $ dash -c '1(){ echo hi;};1' dash: 1: Syntax error: Bad function name $ bash -c '1(){ echo hi;};1' bash: `1': not a valid identifier bash: 1: command not found $ mksh -c '1(){ echo hi;};1' hi 基本上,我试图声明函数1,0这将是true和的简写false,但是如您所见,我在函数中使用数字名称时遇到了问题。别名和两位数名称也会发生相同的行为。 …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.