Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Aug 1995 16:50:07 -0700
From:      "Justin T. Gibbs" <gibbs@freefall.cdrom.com>
To:        current@freefall.cdrom.com
Subject:   sh bug
Message-ID:  <199508012350.QAA14783@freefall.cdrom.com>

next in thread | raw e-mail | index | archive | help

For some reason, this code fragment dies under FreeBSD-Current sh.  Bash
handles it okay.  Basically, the script just dies right after setting
ARCH=FreeBSD-2.0.5.

guess_arch() {
	if [ -f /hp-ux ]; then
		ARCH=hpux9.05
	elif [ -f /vmunix ] && uname -a | grep ultrix > /dev/null 2>&1; then
		ARCH=ultrix4.4
	elif [ -f /386bsd ]; then
		ARCH=FreeBSD-1.1.5
	elif [ -f /kernel ] && uname -a | grep FreeBSD > /dev/null 2>&1; then
		release=`uname -r | sed -e 's/-.*//'`
		if [ "$release" = "2.0" ]; then
			ARCH=FreeBSD-2.0
		else 
			ARCH=FreeBSD-2.0.5
		fi
	elif ....

And a sh -x:

No arch specified.  Trying to guess your architecture.
+ guess_arch
+ [ -f /hp-ux ]
+ [ -f /vmunix ]
+ [ -f /386bsd ]
+ [ -f /kernel ]
+ uname+ grep -a FreeBSD

+ uname+ sed -r -e
 s/-.*//
+ release=2.2
+ [ 2.2 = 2.0 ]
+ ARCH=FreeBSD-2.0.5

I need an alternate way to do this more than a bug fix to sh, but either
would be helpfull. :)

Thanks
__
Justin T. Gibbs
===========================================
  Software Developer - Walnut Creek CDROM
  FreeBSD: Turning PCs into workstations
===========================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508012350.QAA14783>