home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4673 < prev    next >
Encoding:
Internet Message Format  |  1992-11-13  |  1.8 KB

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!csus.edu!beach.csulb.edu!nic.csu.net!csufres.CSUFresno.EDU!oleg
  2. Newsgroups: comp.unix.shell
  3. Subject: read hangs in zsh.
  4. Message-ID: <1992Nov12.212054.3169@nic.csu.net>
  5. From: oleg@csufres.CSUFresno.EDU (Oleg Kibirev)
  6. Date: 12 Nov 92 21:20:54 PST
  7. Distribution: world
  8. Organization: California State University, Fresno
  9. Nntp-Posting-Host: csufres.csufresno.edu
  10. Lines: 44
  11.  
  12. Is this a known problem or am I missing something? The following completely
  13. hangs zsh 2.2.0 - it will even manage to ignore SIGHUP and SIGABRT:
  14.  
  15. gd:~> read foo bar baz
  16. a
  17.  
  18. Note that if I change  "a" to "a  b", it works  fine. Does anyone  knows a way
  19. around  this  bug. Or better   yet, can suggest  how  I can  avoid this   read
  20. alltogether in my .zprofile. The following script  is  supposed to set DISPLAY
  21. environment variable for me automatically when I login from X. It also chooses
  22. X defaults depending on weather  the server has  color display. After klunging
  23. above bug by adding garbage to input for read, it works fine but too slow. Any
  24. suggestions? -- Thanks!
  25.  
  26. Oleg
  27.  
  28. resolve() # Finger will strip long hostname, so I have to fix domain.
  29. {
  30.         IFS='.:         ' read host dom misc
  31.         if ( [ "$dom" = "cs" ] ) {
  32.           echo ${host}.cs.CSUFresno.EDU:0.0
  33.         } else {
  34.           echo ${host}.CSUFresno.EDU:0.0
  35.         }
  36. }
  37.  
  38. if( [ \( .$TERM = .network \) -o \( .$TERM = .unknown \) -o \( .$TERM = . \) ]
  39. ) {
  40.   export TERM=vt100
  41.   stty rows 42 cols 132
  42. } elif ( [ .$DISPLAY = . ] ) {
  43.   export DISPLAY=`finger -swf oleg | awk 'NF == 5 {printf("%s.cs.CSUFresno.EDU\n",$NF) ;exit}' | resolve`
  44. }
  45.  
  46. if( [ .`fgrep -i "$DISPLAY" ~/.color` != . ] ) {
  47.         export XENVIRONMENT=.Xdefaults.color
  48. } else {
  49.         export XENVIRONMENT=.Xdefaults
  50. }
  51.  
  52. unfunction resolve
  53. newfrom
  54. biff y
  55. trap "clear; /usr/games/fortune; exit" 0
  56.