read -a arr
#.的下标所在位置
res=`expr index ${arr[0]} '.'`
res1=`expr index ${arr[1]} '.'`
res2=`expr index ${arr[2]} '.'`
#各个字符串长度
s=`expr length ${arr[0]}`
s1=`expr length ${arr[1]}`
s2=`expr length ${arr[2]}`
#后半段长度
s3=$((s-res))
s4=$((s1-res1))
s5=$((s2-res2))
#前半段
str1=`expr substr ${arr[0]} 1 $((res-1))`
str2=`expr substr ${arr[1]} 1 $((res1-1))`
str3=`expr substr ${arr[2]} 1 $((res2-1))`
#后半段
str4=`expr substr ${arr[0]} $((res+1)) $s3`
str5=`expr substr ${arr[1]} $((res1+1)) $s4`
str6=`expr substr ${arr[2]} $((res2+1)) $s5`
#拼接输出
echo "$str1 $str4"
echo "$str2 $str5"
echo "$str3 $str6"