Title: "Bash Shell: Find Out If a Variable Is Empty Or Not" Date: 2017-01-25 08:26:19 Categories: [programming] tags: [bash]
Pass the -z option to the if command or conditional expression. If the length of STRING is zero, $var is empty.
Link