Home > Article > Operation and Maintenance > What does eq mean in linux
In Linux, eq means "equal"; Linux shell programming will use it to determine whether strings are equal, and "eq" can be used for integer comparison to perform conditional judgment and test whether two integers are equal. , if equal, the result is true, if not equal, the result is false, the syntax is "$A -eq $B".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
In Linux shell programming, it is often used to determine whether strings are equal. The operator that can be used to determine whether strings are equal is '-eq'( equal), '-ne' (not equal to), '-lt' (less than), '-le' (less than or equal to), '-gt' (greater than) or '-ge' (greater than or equal to), and = ,==,!=,.
Command introduction:
Conditional judgment:
If the user does not exist
Add the user, give the password and display the addition successfully;
Otherwise,
Show if it is not there, it is not added;
variable name:
1, can only include letters, numbers, and lower lines, and cannot be able to not be able to Starting with a number;
2. It should not have the same name as an existing environment variable in the system;
3. It is best to be well-known by name;
How to do it in bash Implement conditional judgment?
Conditional test type:
Integer test
Character test
File test
Conditional test expression:
[ expression ] ` expression ` test expression
Integer comparison:
Expand knowledge
The above is the detailed content of What does eq mean in linux. For more information, please follow other related articles on the PHP Chinese website!