TGViewer
Useful Tools | Linux | GitOps | DevOps Useful Tools | Linux | GitOps | DevOps @gitgate · 6.78K subscribers
Post #712 3.39K
Совет дня:

Условные выражения для строковых переменных в 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
More from @gitgate
  1. Oct 5, 2026nvitop - интерактивный просмотрщик процессов NVIDIA-GPU и не только, универсальное решение…
  2. Oct 3, 2026House Planner - планировщик частного дома, двухмерный план этажа в реальном масштабе, трех…
  3. Oct 2, 2026Совет дня: В macOS для предотвращения перехода дисплея в режим сна используется команда: c…
  4. Oct 2, 2026Move Mouse - простая программа, предназначенная для имитации действий пользователя. Изнача…
  5. Oct 1, 2026bash-agent - минималистичная среда выполнения для ИИ-программистов. Чистый bash + awk, ник…
  6. Sep 29, 2026M-Commander - текстовый файловый менеджер в полноэкранном режиме: две панели, встроенный р…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →