The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: Line Splitting
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-29-2005
matrixmadhan matrixmadhan is offline
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,474
not sure of how to do in sed

but here's one more way

Code:
# !/usr/bin/bash
a=0102030405
pos=0
while [ $pos -lt ${#a} ]
do
echo ${a:$pos:2}
pos=$(($pos + 2))
done
exit 0
Reply With Quote