Discrepencies in different environments (GNU/Linux and SUNOS)

Hello,

I have a application that works on a server having SunOS environment. I have to implement it on a different server which has GNU/Linux. Now am facing issues with the shell scripts that are run in the process in the application. It is definitely because of the different flavours of Unix. For example,
1: nawk works in the SunOS but not in GNU/Linux - i had to convert all nawk operations to awk.

2: I also found that new-line char (\n) doesn't work in GNU/Linux and throws "Encountered symbol \ when expecting one of the following..." error. I had to make changes there too.

I want to know if somebody has come across such issue before and can you please put light on some more discrepencies that may occur in this situation. I have to prepare a report of problems faced because of the different environments. So please provide me with points where the different Unix setup might create problems.

Thank You.

If you have an account allowing access to the private regions of The Open Group's website you can find a seven year old technical report that may help here: Conflicts between ISO/IEC 9945 (POSIX) and the Linux Standard Base.

Note that to get POSIX Standards and Single UNIX Specifications conformance on Solaris systems you need to have $PATH set with /usr/xpg4/bin and /usr/bin (in that order) before other directories that contains utilities defined by the standards. Doing this also allows you to use awk (rather than nawk) to get a version of awk that conforms to the standards on Solaris systems.

Thanks Don,

I actually want to do it the other way around. I mean i want the GNU/Linux system to work as how the env in SUNOS is working. Can you provide me a similar suggestion for this.

I don't know of anything that compares common Linux utilities behavior against the default behavior of Solaris system /usr/bin utilities (which meet UNIX System V Interface Definition 3rd Edition requirements with lots of non-conflicting 4.3BSD and 4.4BSD extensions).

I don't see any other way but analysing your code, see what it does, user shell debug (set -x) and run the script.

Differences can be not only in shell, but also in awk (as you mentioned), sed etc.