Unix shell and if Parameters

Source: Internet
Author: User
Tags sorts
Source Address: http://space.itpub.net/10687260/viewspace-293440

[-A file] true if the file exists.
W (g3cu. T * mb7q6a0
[-B file] If the file exists and is a special block file, it is true.
S8ydayx 'gi0
[-C file] If the file exists and is a special word file, it is true. Itpub personal space GPO $ fkkv2c]-
[-D file] If the file exists and is a directory, it is true. Itpub personal space 3O * AOB '-x7br4qy
[-E file] If the file exists, it is true.
M $ yxtvl0
[-F file] If the file exists and is a normal file, it is true.
B5 P & s3cyj) I0
[-G file] If the file exists and the sgid has been set, it is true. Itpub personal space ~
Imjs * og? D
[-H file] If the file exists and is a symbolic connection, it is true.
Xzh9f rkpfpu: D0
[-K file] true if the file exists and the stick bits have been set.
T0m' ^ e] om8d! W0
[-P file] If the file exists and is a name pipe (f If O), it is true.

Zs1 | mzb_m0
[-R file] true if the file exists and is readable.
X8w0l & R. rj_5i, A0
[-S file] If the file exists and the size is not 0, it is true. Itpub personal space 1h5z, gvub & V
[-T fd] It is true if the file descriptor FD is opened and points to a terminal.
2mt3eq7s * c @. bn7l0
[-U file] If the file exists and SUID (Set User ID) is set, it is true.
Aysu! TW/0
[-W file] true if the file exists and is writable. Itpub personal space fkhmhz $ U $ t + MW % N
[-X file] true if the file exists and is executable. Itpub personal space 'rn0kaj! '} 8r
[-O file] true if the file exists and belongs to a valid user ID.
Ym
] ~ Uipd0
[-G file] true if the file exists and belongs to a valid user group. Itpub personal space * IX + F $ G! O5jt
[-L file] If the file exists and is a symbolic connection, it is true. Itpub personal space k2ie6zqe4c _
[-N file] If file exists and has been mod, it is true if IED since it was last read. Itpub personal space! DNV * hm "lo-] O
[-S file] If the file exists and is a socket, it is true.
* 'Ih2ji1v, {oe0
[File1-nt file2] If file1 has been changed more recently than file2, or if file1 exists and file2 does not is true. Itpub personal space! CP running 1xsu
[File1-ot file2] True if file1 is older than file2, or if file2 exists and file1 does not exist. Itpub personal space e9bu) EIG * P
[File1-Ef file2] True if file1 and file2 point to the same device and node number. Itpub personal space J (my2b]/x * R
[-O optionname] true if the shell option "optionname" is enabled. Itpub personal space ^? Z + Lu h1l
[-Z string] "string" is true if its length is zero. Itpub personal space .~ 2? "Z5y7l, L; u
If the length of [-N string] or [String] "string" is non-zero, it is true. Itpub personal space Rz
X; vdy
[String1 = string2] If the two strings are the same. "=" May be used instead of "=" for strict POSIX compliance is true.
0per! Xasxk 'd0
[String1! = String2] true if the strings are not equal. Itpub personal space wmrw {.] g2rk
[String1 <string2] True if "string1" sorts before "string2" lexicographically in the current locale. Itpub personal space % [-^
Ep6f
My # W
[String1> string2] True if "string1" sorts after "string2" lexicographically in the current locale. Itpub personal space
A "pg8a venxe ^ & XA
[Arg1 op arg2] "OP" is one of-EQ,-ne,-lt,-Le,-GT or-ge. These
Arithmetic binary operators return true if "arg1" is equal to, not
Equal to, less than, less than or equal to, greater than, or greater
Than or equal to "arg2", respectively. "arg1" and "arg2" are integers.

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.