home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / k / ksh48.zip / etc / sys_config.sh < prev   
Text File  |  1992-08-25  |  1KB  |  61 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. # RCSid:
  19. #    $Id: sys_config.sh,v 1.2 1992/08/10 12:00:14 sjg Exp $
  20. #
  21. #    @(#)Copyright (c) 1991 Simon J. Gerraty
  22. #
  23. #    This file is provided in the hope that it will
  24. #    be of use.  There is absolutely NO WARRANTY.
  25. #    Permission to copy, redistribute or otherwise
  26. #    use this file is hereby granted provided that
  27. #    the above copyright notice and this notice are
  28. #    left intact.
  29. #
  30.  
  31. # determin machine type
  32. if [ -f /usr/bin/arch ]; then
  33.     ARCH=`arch`
  34. elif [ -f /usr/bin/uname -o -f /bin/uname ]; then
  35.     ARCH=`uname -m`
  36. fi
  37. #
  38. case "$ARCH" in
  39. sun386)    uname=/usr/5bin/uname
  40.     OS=SunOS
  41.     ;;
  42. *)    uname=uname;;
  43. esac
  44.  
  45. # set the operating system type
  46. # you can't use `uname -s` with SCO UNIX
  47. # it returns the same string as `uname -n`
  48. # so set it manually
  49. # OS=SCO-UNIX
  50. # The eval below is a workaround for a bug in the PD ksh.
  51. OS=${OS:-`eval $uname -s`}
  52. HOSTNAME=${HOSTNAME:-`eval $uname -n`}
  53.  
  54. case `echo -n ""` in
  55. -n*)    _C_=""; _N_="-n";;
  56. *)    _C_="\c"; _N_="";;
  57. esac
  58. N="${_N_}"
  59. C="${_C_}"
  60. export OS ARCH HOSTNAME uname
  61.