File: system-id

package info (click to toggle)
pact 980714-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 13,096 kB
  • ctags: 26,034
  • sloc: ansic: 109,076; lisp: 9,645; csh: 7,147; fortran: 1,050; makefile: 136; lex: 95; sh: 32
file content (51 lines) | stat: -rwxr-xr-x 1,007 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/csh -f
#
# SYSTEM-ID - print a hopefully unique system identifier
#           - which is concise (short) and specifies the
#           - hardware (CPU), operarting system, and OS release
#           - NOTE: this is too slow for anything but boot strapping
#

set OS = `uname -s | tr "[A-Z]" "[a-z]"`
set RL = `uname -r`

switch ($OS[1])
   case "hp-ux" :
        echo "hpux-$RL"
        breaksw

   case "riscos" :
	echo "risc-$RL"
        breaksw

   case "linux" :
        echo "lnx-$RL"
        breaksw

   case "sunos" :
        set HW = `uname -m`
        if (`expr $HW : '.*3.*'`) then
           echo "sun3-$RL"
        else if (`expr $HW : '.*4.*'`) then
           echo "sparc-$RL"
        else if (`expr $HW : '.*sparc.*'`) then
           echo "sparc-$RL"
        else
           echo "sun-$RL"
        endif
        breaksw

   default :

        if ($OS[1] != "") then
           echo "$OS[1]-$RL"
        else
           echo "$RL"
        endif
        breaksw

endsw

exit($status)