read -d@ a for i in ${a//[^0-9]/ };{ ${i#0};c+=${a/$_*}$[_+1] a=${a#*$_};};echo "$c$a"
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page