#!/bin/bash echo $BASH echo $BASH_VERSION echo $COLUMNS echo $HOME echo $PATH echo '$USER is: '"$USER"
#!/bin/bash name='Lin Chen' echo $name val=bus echo $val vech= # define NULL variable echo $vech unset val # unset variable
#!/bin/bash echo $$ # process id echo $? # The exit status of the last command executed echo $! # The process number of the last background command
#!/bin/bash
# If var is null or unset, print the default value
echo ${var:-"Not defined ..."}
# If var is null or unset, var is set to the specified value
echo ${var:="Set value ..."}
echo $var
# If var is null or unset, message is printed to standard error
unset var
echo ${var:?"Warning message ..."} # print warning and exit
# If var is set, word is substituted for var
var="Hello"
echo ${var:+"Substitution ..."} # Substitution
echo $var # Hello