word_reverse() { local string="$1" new='' for s in $string do new="$s $new" done printf "%s" "${new%% }" } word_reverse " one two three four "