On Fri, 2003-11-07 at 11:02, Toad wrote:
> We need to set LD_ASSUME_KERNEL on Linux 2.6, as well as on redhat etc.
> I have some bash code to do this, but for start-freenet.sh it needs to
> be cross platform, so I hoped somebody here might be able to help. My
> current code is:
> #!/bin/bash
> if ([ `uname` == 'Linux' ]); then
>   echo Linux detected;
>     if (uname -r | grep "2\.[6-9]" > /dev/null) ||
>        (uname -r | grep "3\." > /dev/null); then
>        echo Linux 2.6+ detected;
>   fi
> fi


Google for portable shell uname man page found this:

http://www.raycosoft.com/rayco/support/porting.html

It is full of useful information I didn't know about before, such
as the fact that ksh is available most everywhere.

It points to the Unix Manual Page Multiplexer provided by FreeBSD:

http://www.freebsd.org/cgi/man.cgi

raycosoft gives this example script, plus a very long table
of uname values for what looks like nearly every extant unix,
and lots of other info and references.

(The space after #! helps on old versions of BSD.)

#! /bin/ksh
case $( uname ) in
   AIX) 
      # Insert AIX code here
   ;;
   HP-UX) 
      # Insert HP-UX code here
   ;;
   Linux) 
      # Insert Linux code here
   ;;
   *) 
      print -n "Sorry, ${0##*/} has not been ported" 1>&2
      print " to the $( uname ) operating system" 1>&2
      exit 1
   ;;
esac




_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to