Полезные бесплатные opensource инструменты на все случаи жизни, а иногда и советы.
Понравился проект из поста - поддержи автора звездой!
Web: https://gitgate.d3.ru
Сотрудничество: @maxgrue
Post #712
3.39K
Совет дня:
Условные выражения для строковых переменных в
опубликовано в @gitgate
#tips #bash
Условные выражения для строковых переменных в
bash# 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} ]]
опубликовано в @gitgate
#tips #bash
- 👍 32
- 🔥 10





