Windows批处理文件中相当于NEQ、LSS、GTR等的符号 [英] Symbol equivalent to NEQ, LSS, GTR, etc. in Windows batch files

查看:56
本文介绍了Windows批处理文件中相当于NEQ、LSS、GTR等的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在批处理中,我在使用 if 命令时总是使用 ==.(例如:if "19"=="3" echo My computer doesn't know maths)

In batch I always use == when using the if command. (For example: if "19"=="3" echo My computer doesnt know maths)

其他所有(LSSLEQNEQ 等)呢?NEQ 不是有类似 != 的东西,还是我在想 Unix?

What about for all of the others (LSS, LEQ, NEQ, etc.)? Isn't there something like != for NEQ, or am I thinking Unix?

我想使用符号的原因是因为我认为有人说文本或数字符号比使用文本变体更有效.

The reason I want to use symbols is because I thought someone had said for either text or numbers symbols were more efficient than using the text variants.

不管怎样,我还是想知道.谢谢.

Either way, I'd still like to know. Thanks.

推荐答案

不使用 > 等运算符的原因是它们在 shell 脚本中具有特殊含义.> 用于重定向输出;< 用于重定向输入等

The reason operators like > are not used is because they have special meanings in shell scripts. The > is used to redirect output; < used to redirect input, etc.

来自 Microsoft 的文档 列表以下运算符:

Operator | Description
EQU      | equal to
NEQ      | not equal to
LSS      | less than
LEQ      | less than or equal to
GTR      | greater than
GEQ      | greater than or equal to

此外,单词not 用于否定条件.

In addition the word not is used to negate a condition.

我想使用符号的原因是因为我认为有人说文本或数字符号比使用文本变体更有效.

The reason I want to use symbols is because I thought someone had said for either text or numbers symbols were more efficient than using the text variants.

他们可能指的是 bash 及其大目录运营商.它为整数和字符串操作数提供了不同的运算符.

They were probably referring to bash and its large catalog of operators. It provides different operators for integer and string operands.

这篇关于Windows批处理文件中相当于NEQ、LSS、GTR等的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆