home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / useful / dist / util / shell / pdksh / etc / sys_config.sh < prev   
Text File  |  1993-12-01  |  2KB  |  69 lines

  1. :
  2. # NAME:
  3. #    sys_config.sh - set system specific variables
  4. #
  5. # SYNOPSIS:
  6. #    . /etc/sys_config.sh
  7. #
  8. # DESCRIPTION:
  9. #    Source this script into shell scripts that want to handle
  10. #    various system types.
  11. #    You may well want to edit this on a particular system replacing 
  12. #    `uname -s` etc with the result.  So that the facility will work 
  13. #    even when in single user mode and uname et al are not available.
  14. #
  15. # SEE ALSO:
  16. #    /etc/profile
  17. #
  18. # AMENDED:
  19. #    91/11/05 22:09:08 (rook)
  20. #
  21. # RELEASED:
  22. #    91/11/05 22:09:09 v1.3
  23. #
  24. # SCCSID:
  25. #    @(#)sys_config.sh 1.3 91/11/05 22:09:08 (rook)
  26. #
  27. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  28. #
  29. #    This file is provided in the hope that it will
  30. #    be of use.  There is absolutely NO WARRANTY.
  31. #    Permission to copy, redistribute or otherwise
  32. #    use this file is hereby granted provided that 
  33. #    the above copyright notice and this notice are
  34. #    left intact. 
  35. #
  36.  
  37. # determin machine type
  38. if [ -f /usr/bin/arch ]; then
  39.     ARCH=`arch`
  40. elif [ -f /usr/bin/uname -o -f /bin/uname ]; then
  41.     ARCH=`uname -m`
  42. fi
  43. #
  44. case "$ARCH" in
  45. sun386)    uname=/usr/5bin/uname
  46.     OS=SunOS
  47.     ;;
  48. *)    uname=uname;;
  49. esac
  50.  
  51. # set the operating system type
  52. # you can't use `uname -s` with SCO UNIX
  53. # it returns the same string as `uname -n`
  54. # so set it manually
  55. # OS=SCO-UNIX
  56. # The eval below is a workaround for a bug in the PD ksh.
  57. OS=${OS:-`eval $uname -s`}
  58. HOSTNAME=${HOSTNAME:-`eval $uname -n`}
  59.  
  60. # set which ever is required to not produce a linefeed 
  61. # in an echo(1)
  62. case $OS in
  63. SunOS)    C="\c"; N="";
  64.     ;;
  65. *)    C="\c"; N=""
  66.     ;;
  67. esac
  68. export OS ARCH HOSTNAME C N uname
  69.