There are multiple ways to check if a variable is empty and then set it to some default value. Shell parameter expansion gives us an elegant way to do this in one line. Here are sample code snippet for this.