function header { HEADING=$1 echo "" echo ${HEADING//[[:print:]]/=} echo ${HEADING} echo ${HEADING//[[:print:]]/=} } header "ls -l output" ls -l