linux if
1885 ワード
[ -a FILE ] FILE 。
[ -b FILE ] FILE 。
[ -c FILE ] FILE 。
[ -d FILE ] FILE 。
[ -e FILE ] FILE 。
[ -f FILE ] FILE 。
[ -g FILE ] FILE SGID 。
[ -h FILE ] FILE 。
[ -k FILE ] FILE 。
[ -p FILE ] FILE (F O) 。
[ -r FILE ] FILE 。
[ -s FILE ] FILE 0 。
[ -t FD ] FD 。
[ -u FILE ] FILE SUID (set user ID) 。
[ -w FILE ] FILE FILE 。
[ -x FILE ] FILE 。
[ -O FILE ] FILE ID 。
[ -G FILE ] FILE 。
[ -L FILE ] FILE 。
[ -N FILE ] FILE and has been mod ied since it was last read 。
[ -S FILE ] FILE 。
[ FILE1 -nt FILE2 ] FILE1 has been changed more recently than FILE2, or FILE1 exists and FILE2 does not 。
[ FILE1 -ot FILE2 ] FILE1 FILE2 , FILE2 FILE1 。
[ FILE1 -ef FILE2 ] FILE1 FILE2 。
[ -o OPTIONNAME ] shell “OPTIONNAME” 。
[ -z STRING ] “STRING” 。
[ -n STRING ] or [ STRING ] “STRING” non-zero 。
[ STRING1 == STRING2 ] 2 。 “=” may be used instead of “==” for strict POSIX compliance 。
[ STRING1 != STRING2 ] 。
[ STRING1 < STRING2 ] “STRING1” sorts before “STRING2” lexicographically in the current locale 。
[ STRING1 > STRING2 ] “STRING1” sorts after “STRING2” lexicographically in the current locale 。
[ 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.