You can use the Substring Extraction (see
http://tldp.org/LDP/abs/html/string-manipulation.html[
^]):
stringInput=12345678
str1=${stringInput:0:2} # 12
str2=${stringInput:2:2} # 34
str3=${stringInput:4:2} # 56
str4=${stringInput:6:2} # 78
If the input string has variable length use a loop (
${#stringInput}
returns the length of the string and use variables for the
position and
length parameters of the substring extraction).
[EDIT]
The above are for
bash. But the link contains also examples using the UNIX
expr command. But note that the
expr command uses 1-based indexes.