Shell script Operators

Source: Internet
Author: User
Tags logical operators

1. Value

Format:

Test "NUM1" OPR "num2"

["Num1" OPR "num2"]

OPR Value:

Equality:-EQ

Unequal:-ne

Greater than:-GT

Less than:-lt "L is the lowercase letter L"

Less than equals:-le

Greater than or equal to:-ge

2. String

Format:

[Str1 OPR str2]

[OPR str]

OPR Value:

Equality: =

Unequal:! =

Empty string:-Z

Non-empty string:-N

3. Documents

Format:

[OPR file]

OPR Value:

Folder:-D

File:-F

Link:-L

Readable:-R

Writable:-W

Can run:-X

File non-null:-S

4. Logical operators

Logic with:-a format: [Condition1-a Condition2]

Logical OR:-o format: [Condition1-o Condition2]

Logic No:! Format: [! condition]

Shell script Operators

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.