#!/bin/sh
#
# uname
#
# Author: Jim Vlcek, ByteWare Consulting (uunet!molly!vlcek) 3 Dec 1993
#
# An attempt to implement a SysV-ish "uname" under NeXTStep 3.0
#
# Options
#
# -s    Print the operating system name
# -n    Print the node name (essentially, the hostname)
# -v    Print the operating system version
# -r    Print the operating system release
# -p    Print the host machine's processor type
# -m    Print the machine hardware name
# -a    Print all the above information
#
# Non-SysV options
#
# -i    Print the host identification number (hostid)
#

if [ $# = 0 ]
then
        system="NEXTSTEP "
fi

for arg
do
        case $arg in
                -s)     system="NEXTSTEP " ;;
                -n)     node="`uuname -l` " ;;
                -r)     release="`hostinfo | sed -n 's/.*NeXT Mach  
\([0-9\.]*\).*/\1/p'` " ;;
                -m)     mach="`hostinfo | sed -n 's/.*Processor type: \([^  
]*\).*/\1/p'` " ;;
                -p)     processor="`hostinfo | sed -n 's/.*Processor type: [^  
]* (\([^)]*\).*/\1/p'` " ;;
                -v)     version="`tail -1 /usr/lib/NextStep/software_version` "  
;;
                -i)     hostid="`hostid` " ;;
                -a)     exec $0 -s -n -v -r -p -m ;;
                *)      echo $0: Usage: $0 [-asnvrpm] >&2 ; exit 1 ;;
        esac
done

echo "$system""$node""$version""$release""$processor""$mach" | sed -e 's/ $//'

