${parameter:-word} Use Default Values. ${parameter:=word} Assign Default Values. ${parameter:?[word]} Indicate Error if Null or Unset. ${parameter:+word} Use Alternative Value. ${#parameter} String Length. ${parameter%word} Remove Smallest Suffix Pattern. ${parameter%%word} Remove Largest Suffix Pattern. ${parameter#word} Remove Smallest Prefix Pattern. ${parameter##word} Remove Largest Prefix Pattern. ./cmd 123 a b cd #!/bin/sh echo ${#1} # 3 (length of first parameter) # pattern match check the following site: # http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13 f='/home/cpfong/test.txt' base=$(printf %s ${f##*/}) dir=$(printf %s ${f%/*})