bash.sh
· 749 B · Bash
Brut
# True if the shell variable varname is set (has been assigned a value).
[[ -v ${varname} ]]
# True if the length of the string is zero.
[[ -z ${string} ]]
# True if the length of the string is non-zero.
[[ -n ${string} ]]
# True if the strings are equal. = should be used with the test command for POSIX conformance. When used with the [[ command, this performs pattern matching as described above (Compound Commands)
[[ ${string1} == ${string2} ]]
# True if the strings are not equal.
[[ ${string1} != ${string2} ]]
# True if string1 sorts before string2 lexicographically.
[[ ${string1} < ${string2} ]]
# True if string1 sorts after string2 lexicographically.
[[ ${string1} > ${string2} ]]
Опубликовано в https://t.me/gitgate
1 | # True if the shell variable varname is set (has been assigned a value). |
2 | [[ -v ${varname} ]] |
3 | |
4 | # True if the length of the string is zero. |
5 | [[ -z ${string} ]] |
6 | |
7 | # True if the length of the string is non-zero. |
8 | [[ -n ${string} ]] |
9 | |
10 | # True if the strings are equal. = should be used with the test command for POSIX conformance. When used with the [[ command, this performs pattern matching as described above (Compound Commands) |
11 | [[ ${string1} == ${string2} ]] |
12 | |
13 | # True if the strings are not equal. |
14 | [[ ${string1} != ${string2} ]] |
15 | |
16 | # True if string1 sorts before string2 lexicographically. |
17 | [[ ${string1} < ${string2} ]] |
18 | |
19 | # True if string1 sorts after string2 lexicographically. |
20 | [[ ${string1} > ${string2} ]] |
21 | |
22 | Опубликовано в https://t.me/gitgate |
23 |