From: bsh on
David Kirkby <drkir...(a)> wrote:
> I have this in a script, where $UNAME will be the output of 'uname',
> except on Cygwin, where it will be "CYGWIN".

P.S. I hope you are not writing your own host detection script.
The best one is config.guess from the autoconf distribution:; "determine 'canonical host triple'"

.... But plenty others exist, including: "determine OS/distribution/version: NCA?" "guess machine's application architecture" "platform identification utility"
<shtools-distribution>/ "determine type of host: contained-in Msys distribution"

> What of the following two lines is more portable?
> if [ "x$UNAME" != xSunOS ] && [ "x$UNAME" != xCYGWIN ] && [ "x$UNAME" !
> = xHP-UX ]; then
> or
> if [ "$UNAME" = SunOS -a "$UNAME" = CYGWIN -a "$UNAME" = HP-UX ]; then
> I believe the former is more portable, but someone has suggested the
> use of the latter.

Hello Dave,

I'm a bit confused as this is a question already asked and answered: