set IV XL CD IX XC CM I X C V L D M d=({4,9,1,5}{,0,00} 1000) while read a do for i { a=${a//$i/+${d[j++]}} } echo $[a] j= done
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page