Problem Statement
How do you check if a string is empty or not in Bash?
Explanation
You can use the -z flag to test if a string is empty and -n to test if it’s not.
Conditional checks like if [ -z "$name" ]; then echo 'Empty'; fi help control program flow based on user input.
Code Solution
SolutionRead Only
if [ -z "$input" ]; then echo 'Empty' fi