to_lower() { input="$1" output=$( echo $1 | tr [:upper:] [:lower:] ) **return $output** } In book, to_lower() is returning a string which is not possible in bash. the script does not work.