Portability issues (SunOS 4.1.x is base)
----------------------------------------

* The HPUX version of 'tar' doesn't recognize the "B" option.

* The 'expand' and 'unexpand' commands are BSDisms; they're present in
  Solaris but not in IRIX.  There does not seem to be a good substitute apart
  from the implementation in GNU textutils.

* The 'grep' command in SunOS 5.x (and possibly other SysV unixes) ignores
  lines longer than 1024 characters (it doesn't simply truncate them as the
  man pages state).  The BSD and GNU versions do not have this limitation.

* Bourne shell in Ultrix doesn't recognize "${parameter:-word}" parameter
  substitution (if parameter is set and is nonnull substitute its value,
  otherwise substitute word), use "${parameter-word}" instead (if parameter
  is set substitute its value otherwise, substitute word).

* The IRIX version of 'ar' refuses to insert an empty module.

* The 'whoami' command is a BSDism.  The account name is set in the LOGNAME
  and/or USER environment variables by 'login' on all systems tested.  Most
  set both, but ULTRIX only sets USER and SunOS 5.x only LOGNAME (csh in
  SunOS 5.x also sets USER).  Thus in Bourne shell the user name can be
  obtained as ${LOGNAME-$USER}, and something similar can be used in other
  shells.

* The 'head' command in IRIX is considered to be a BSDism - but not so in
  SunOS 5.x, and it's also present in AIX.  An alternative to 'head -5 file'
  would be 'sed -n -e 1,5p file'.

* In IRIX (SGI) preformatted man pages reside in /usr/catman/local,
  /usr/share/catman, /usr/share/man, /usr/catman, and /usr/man.  Since this
  is so non-standard I have not added these directories to the default MANPATH
  in login, so they must be added in .login_local.

* In IRIX (SGI) BSD utilities reside in /usr/bsd rather than in /usr/ucb.

* Differences between GNU 'sed' and unix 'sed'.

  0) The pattern and hold spaces in GNU 'sed' are effectively unlimited since
     it allocates memory on demand.  However, it's possible to exhaust these
     in ordinary 'sed'.  Scripts which place demands on these buffers must
     therefore be tested using ordinary 'sed'.

  1) SunOS (4.1.3 and 5.2), ConvexOS 10.1, Ultrix 4.3, and AIX 2:

        (echo a ; echo b ; echo c) | sed -e '1,2N'

     produces

        a
        b
        c

     whereas GNU 'sed' (1.18, 2.03, 2.05) produces:

        a
        b

  2) SunOS 4.1.3 'sed' always filters out <nul> characters, whereas GNU
     'sed' (2.03) passes them.  This affects binary files in particular.
     Neither recognize <nul> characters as being substitutable.

  3) SunOS (4.1.3 and 5.2), ConvexOS 10.1, Ultrix 4.3:

        echo a/b/c | sed -e s#\([^/]*$\)#.\1#

     produces

        a/b/c

     whereas GNU 'sed' (2.03, 2.05) produces

        a/b/.c

     If changed to

        echo a/b/c | sed -e s#\([^/]*\)$#.\1#

     all versions produced

        a/b/.c

  4) SunOS (4.1.3 and 5.3), ConvexOS 10.1, Ultrix 4.3:

     None of these allow nested "{}" while GNU sed does.

* In SunOS 5.x (SysV) 'stty' does not have the "crt" option and "sane" must be
  used instead.  However, 'stty sane' in ConvexOS does not enable "echoe",
  "echoke", or "echoctl" so these must be set explicitly.

* In ULTRIX, redirection of stderr to /dev/null within a "()" subshell returns
  "sh:illegal io".  This can be avoided by replacing the redirection outside
  the subshell.  For example, replace

     DIR=`(cd $AIPSROOT 2> /dev/null && pwd)`

  with

     DIR=`(cd $AIPSROOT && pwd) 2> /dev/null`

* Neither ConvexOS nor ULTRIX support shell functions.

* ConvexOS does not support 'test -x'.

* ConvexOS has a bug in the 'read' builtin command in 'sh' which requires that
  when reading into multiple variables the input fields must be separated by a
  single space.

* ConvexOS does not support 'date' formatting.

* In AIX (System V) the "-s" option to 'grep' has a different meaning.

* In AIX (System V) the "-g" option to 'ls' has a different meaning.

* In AIX, the "-h" option to 'test' is "-L".

* Bourne shell in AIX doesn't have 'chdir'.

* The IBM C and C++ compilers do not support the "-o" option for object
  modules, only for executables.

* The following does not have the expected behaviour in early versions of
  'bash'

     jjj=`echo abc.def | sed -e 's/\..*//'`

  The null string is assigned to jjj.

* Escape sequences in the "prompt" shell variable in 'tcsh' must be enclosed
  within "%{" and "%}".

* SunOS 5.x (Solaris 2.x):

     1) Doesn't have 'hostname', the SysV method is to use 'uname -n' but this
        is not always present on BSD based unixes (e.g. ConvexOS).

     2) Doesn't have 'arch' or any direct replacement for it; 'uname -m'
        reports a different value, e.g. "sun4c" instead of "sun4".

     3) 'echo -n'  becomes 'echo "...\c"'.

  A possible temporary solution is to explicitly add "/usr/ucb" to PATH ahead
  of "/usr/bin:/bin".
