Donald Feury
  • 📝 Topics
  • 💲 Donate
  • 🌎 Links
  • ✉️ Contact
  • ▶️ Videos
Subscribe

Bash

Everything can be solved with a little Bash
How to do conditional execution in Bash
Bash

How to do conditional execution in Bash

In Bash scripts, any command following a && will only execute if the previous conditional or command succeeded (returned 0)
Oct 23, 2021 1 min read
How to check if a string is empty in Bash
Bash

How to check if a string is empty in Bash

To check if a string is empty in a Bash script, use the -z conditional which returns 0 (true) if the length of the string is 0 and 1 (false) if it is greater than 0. myVar="hello" if [[ -z "$myVar" ]]; then echo "myVar is empty" else echo "myVar is
Oct 22, 2021 1 min read
Donald Feury © 2025
  • 💲 Drop me a donation
  • 🗠 Check my stats
  • ❓ FAQ
  • ✉️ Contact Me
Powered by Ghost