* Filename FNAME=$1 CASE1="${FNAME%%.*}" BNAME="${FNAME%.*}" CASE3="${FNAME#*.}" BEXTN="${FNAME##*.}" echo "CASE1 = $CASE1" echo "CASE3 = $CASE3" echo "BNAME = $BNAME" echo "BEXTN = $BEXTN" * Basic Tutorial https://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14 * List of test condition options https://kapeli.com/cheat_sheets/Bash_Test_Operators.docset/Contents/Resources/Documents/index -e --> file exists -z --> string is null -n --> string is not null * $# --> number of args $@ --> list of args (not including $0) $0 --> arg 0 (name of program) $1 --> arg 1 if [ -z "$2" ]; then (code) else (code) fi for arg in "$@" do code done echo "Total Args : $#"