Unix scripting

how to check if a unix script gets executed without errors across all unix platforms.

incase if a script gets executed without errors only one platform say AIX, what needs to be done to that script such that it will run all unix platforms like linux, hp, sun etc

In the days of yore, the way to ensure that a shell script ran on all Unix platforms was to write the shell script to use the Bourne shell, i.e. /bin/sh. The GNU/Linux crowd muddied the waters by hijacking the previously accepted meaning of /bin/sh. In the world of GNU/Linux, /bin/sh means the Bash shell. Nowadays the way to write portable scripts is to ensure that you only use shell syntax and constructs which conform to the POSIX.1 standard.

thanks