Languages
[Edit]
EN

Bash - check if string is empty

0 points
Created by:
Pearl-Hurley
559

This article will show you how to check if the string is empty in Bash.

Quick solution:

Example output:

 

Practical examples

Edit

1. With control operators

Edit

Example output:

2. With if statement

Edit

Output:

Alternative if statement example

Edit

Output:

Alternative titles

  1. Bash - check if variable is empty
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - check if string is empty
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join