If you are using ksh93 you do not need to invoke external utilities like cut or
sed. The following will work
Code:
$ str="/rmsprd/arch01/rmsprd/rmsprdarch72736.log"
$ print $str
/rmsprd/arch01/rmsprd/rmsprdarch72736.log
$ print ${str/*([[:print:]])({5}(\d)).log/\2}
72736
$