You can do it all in shell
(without calling external utilities, like
sed for example), but it depends on your ksh version.
Is
N in fixed or variable position?
One or many occurrences?
With ksh93(dtksh on Solaris):
Code:
$ print ${.sh.version}
Version M 1993-12-28 r
$ v="N557788"
$ print -- ${v/N/-}
-557788
For older versions of ksh the solution depends on the answers of the above questions.