home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / admin / 9679 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  3.9 KB

  1. Xref: sparky comp.sys.sun.admin:9679 comp.unix.questions:14900
  2. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!jmoore
  3. From: jmoore@ssd.kodak.com (James H. Moore 726-0322)
  4. Newsgroups: comp.sys.sun.admin,comp.unix.questions
  5. Subject: curious csh behavior
  6. Message-ID: <1992Dec22.224646.17949@pixel.kodak.com>
  7. Date: 22 Dec 92 22:46:46 GMT
  8. References: <BUSSIERE.92Dec22130944@tohi.DMI.USherb.CA>
  9. Sender: news@pixel.kodak.com
  10. Organization: Eastman Kodak
  11. Lines: 122
  12.  
  13. I know that I am pushing it with csh.  I have read the cshell can be harmful
  14. to your health, and right now I am starting to believe it.
  15.  
  16. I have hit 2 cases of unusual behavior in the past 2 weeks.  First, I wrote
  17. a large csh script, which started exhibiting strange errors on syntactically
  18. correct lines, until I started unsetting some variables along the way. (Is 
  19. there a known namespace bug?).  Also, the same script will work fine, until 
  20. I branch into some code which only gets executed optionally, I come down into
  21. a section of csh that looks like:
  22.  
  23. #Do we still have a remaining filename or filename part
  24. if ( $#argv == 0 ) then
  25.         set FILENAME=$File_base
  26.         echo "$Note_header " >! $FILENAME
  27. else
  28.         echo "will it continue to process"
  29. .
  30. .
  31. .
  32. endif
  33.  
  34. #Shell variable name space is tight in this script
  35. unsetenv File_base Note_header file_pattern p2
  36.         
  37. echo "" >> $FILENAME
  38.  
  39.  
  40. ---  And what I get is:
  41.  
  42. if ( 0 == 0 ) then
  43. set FILENAME=WH_Notes
  44. echo WIN: ####  Warehouse Notes for  
  45. else
  46. Subscript out of range.
  47.  
  48. - - - - - - - - - - - - - - - - - - - -
  49.  
  50. Weird Case #2
  51.  
  52. I am  searching for a faster way of starting up my default shell (csh).
  53. So instead of running checks for the existance of directories and incrementally
  54. building my path, I run a cron job, and it builds my path which I source.
  55.  
  56. I source some systems variables, and other things related to default path,
  57. and manpath in my script, which enables my cron job to look very similar
  58. to the regular login.  (These files are sourced first by normal logins).
  59.  
  60. I get a very strange message: from the following code fragment.
  61.  
  62.  
  63. ##################################################################
  64. #  Set the environment (for cron job) just like a login
  65. ##################################################################
  66. #
  67. #
  68. source /usr/local/share/etc/FAST_LOGIN/variables
  69. source /usr/local/share/etc/FAST_LOGIN/path
  70. source /usr/local/share/etc/FAST_LOGIN/lib
  71. source /usr/local/share/etc/FAST_LOGIN/manpath
  72.  
  73. set verbose
  74.  
  75. #Set the Architecture and OS environment versions
  76. #Determine the Architecture and OS for Sun equipment
  77. set arch = `/bin/arch`
  78. setenv ARCH "$arch"
  79. unset arch
  80. echo $ARCH
  81.  
  82.  
  83.  
  84. - - - - - - - Output - - - - -
  85. source /usr/local/share/etc/FAST_LOGIN/variables
  86.     setenv True 1
  87.     setenv False 0
  88.     setenv Found 0
  89.     setenv Defined 1
  90.     setenv LOCAL2NET /usr/local
  91.     setenv LOCAL2MACH /packages
  92. .
  93. .
  94. .
  95.  
  96. source /usr/local/share/etc/FAST_LOGIN/path
  97.     if ( $?DEBUG ) echo "setting mypath"
  98.     set mypath= ( )
  99.     set stdpath= ( /usr/ucb /bin /usr/bin )
  100.     set localpath= ( ${LOCAL2NET}/share/scripts ${LOCAL2NET}/bin )
  101.     set systems_path= ( /etc /usr/etc /usr/etc/yp /usr/5bin /usr/install )
  102.  
  103.  
  104. source /usr/local/share/etc/FAST_LOGIN/lib
  105.     setenv LD_LIBRARY_PATH "/usr/local/lib"
  106.  
  107. source /usr/local/share/etc/FAST_LOGIN/manpath
  108.     setenv MANPATH "${LOCAL2NET}/share/man:/usr/share/man"
  109.     setenv MYMANPATH ""
  110.  
  111. set arch = `/bin/arch`
  112. setenv ARCH "$arch"
  113. unset arch
  114. echo $ARCH
  115. No message !?!
  116.  
  117. Any ideas what is happening?
  118.  
  119. - - - - - - - -
  120.  
  121.  
  122. Thanks in advance.  Please respond to me by email.  And yes I know that I
  123. could write the 1st script in perl, and probably will! 
  124.  
  125. Oh, and by the way, Merry Christmas Netters!
  126.  
  127.                         Sincerely,
  128.  
  129.                         Jim
  130. -- 
  131. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  132. - - James H. Moore, The Software Warehouse, Eastman Kodak Co. 726-0322  -
  133. - -  jmoore@pixel.kodak.com, PROFS: EKSMTP(JMOORE)  VMS: UX047A::JMOORE -
  134. - -  May God bless you, in Jesus' name for blessing me with your help - -
  135.