I have the following problem:
- I have some test scripts that previously were run with ksh (from MKS Toolkit)
- The scripts will need to remain unmodified (not a single character will be changed).
- I will use bash (from Mingw/Msys) to run these scripts.
The problem is in the following:
This works fine in KornShell (ksh) but doesn't work in bash:
typeset -i errorCode
errorCode=10
exit errorCode
I need to modify the script like this (note the $ sign):
typeset -i errorCode
errorCode=10
exit $errorCode
Is there a way to make the code to be compilable with bash without making the chnage I mentioned?
Thanks
you can also do this before executing the ksh script in bash
to override exit. This example is compatible with the original code, i.e. gives exit code of 0.
Second example
will produce the exit code 10, probably what the original script intends.