#!/bin/ksh -p name="this.is.a.test.ac.uk" name2=$(echo $name|sed 's/\./ /g') set -A k $name2 length=${#k} out="" i=$((length+1)) while ((i > 0)) ; do out=$out${k[$i]}"." i=$((i-1)) done out=$out${k[0]} echo $out