osrelease.sh revision 1.107
11.1Slukem#!/bin/sh
21.1Slukem#
31.107Sjdolecek#	$NetBSD: osrelease.sh,v 1.107 2003/10/04 06:59:56 jdolecek Exp $
41.1Slukem#
51.1Slukem# Copyright (c) 1997 The NetBSD Foundation, Inc.
61.1Slukem# All rights reserved.
71.1Slukem#
81.1Slukem# This code is derived from software contributed to The NetBSD Foundation
91.1Slukem# by Luke Mewburn.
101.1Slukem#
111.1Slukem# Redistribution and use in source and binary forms, with or without
121.1Slukem# modification, are permitted provided that the following conditions
131.1Slukem# are met:
141.1Slukem# 1. Redistributions of source code must retain the above copyright
151.1Slukem#    notice, this list of conditions and the following disclaimer.
161.1Slukem# 2. Redistributions in binary form must reproduce the above copyright
171.1Slukem#    notice, this list of conditions and the following disclaimer in the
181.1Slukem#    documentation and/or other materials provided with the distribution.
191.1Slukem# 3. All advertising materials mentioning features or use of this software
201.1Slukem#    must display the following acknowledgement:
211.1Slukem#        This product includes software developed by the NetBSD
221.1Slukem#        Foundation, Inc. and its contributors.
231.1Slukem# 4. Neither the name of The NetBSD Foundation nor the names of its
241.1Slukem#    contributors may be used to endorse or promote products derived
251.1Slukem#    from this software without specific prior written permission.
261.1Slukem#
271.1Slukem# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
281.1Slukem# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
291.1Slukem# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
301.4Sjtc# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
311.4Sjtc# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
321.1Slukem# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
331.1Slukem# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
341.1Slukem# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
351.1Slukem# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
361.1Slukem# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
371.1Slukem# POSSIBILITY OF SUCH DAMAGE.
381.1Slukem#
391.1Slukem
401.78Slukem# Release number to use.
411.107Sjdolecek# We use the number specified in <sys/param.h>
421.107Sjdolecek
431.107SjdolecekAWK=${AWK:-awk}
441.107SjdolecekGREP=${GREP:-grep}
451.107SjdolecekPARAMH="`dirname $0`"/../sys/param.h
461.107Sjdolecekrelease=`$AWK '/^#define[ 	]*__NetBSD_Version__/ { print $6 }' $PARAMH`
471.1Slukem
481.1Slukemcase $1 in
491.1Slukem-s)
501.1Slukem	echo $release | sed -e 's,\.,,g'
511.1Slukem	;;
521.1Slukem*)
531.1Slukem	echo $release
541.1Slukem	;;
551.1Slukemesac
56