how to set default value in shell script code example

Example 1: assign default value in shell script

FOO=${VARIABLE:-default}  # If variable not set or null, use default.

Example 2: set default shell to bash

#to change your default shell on any GNU/Linux distro 
#you need to use chsh

#For example if you want to change your default shell to bash
#you need to do this:
#first you need the full path to the bash executable
chsh -l

#then using the path for bash you need to write:
chsh -s /your/path/to/bash
#chsh -s /bin/bash for example

Tags:

Misc Example