Check for empty parameters Bash


To check for empty parameters using bash.

Use the below

Check for Empty

 if [ -z "$1" ]

Check for not empty

if [ -n "$VAR" ]
Advertisements