NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
fixed uname -r

 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software
View previous topic :: View next topic  
Author Message
roytam1



Joined: 25 Aug 2008
Posts: 3

PostPosted: Sat Mar 31, 2012 9:20 pm    Post subject: fixed uname -r Reply with quote

The uname from http://www.nextcomputers.org/NeXTfiles/Software/NEXTSTEP/Developer/uname.gz has `uname -r` broken which returns nothing.
The attached version fixes this issue.

Code:
#!/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/ $//'

Back to top
View user's profile Send private message
eagle



Joined: 29 Mar 2006
Posts: 393

PostPosted: Fri Jun 19, 2015 4:08 am    Post subject: Reply with quote

Thank you for posting this. I have a script that uses uname, and I was glad to find this on the forums!
_________________
My NeXTs:
NeXT Computer prototype (68030-25 x2, 68040-25)
Two NeXTstations (68040-25)
All mono
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2017 phpBB Group