home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!wupost!csus.edu!beach.csulb.edu!nic.csu.net!csufres.CSUFresno.EDU!oleg
- Newsgroups: comp.unix.shell
- Subject: read hangs in zsh.
- Message-ID: <1992Nov12.212054.3169@nic.csu.net>
- From: oleg@csufres.CSUFresno.EDU (Oleg Kibirev)
- Date: 12 Nov 92 21:20:54 PST
- Distribution: world
- Organization: California State University, Fresno
- Nntp-Posting-Host: csufres.csufresno.edu
- Lines: 44
-
- Is this a known problem or am I missing something? The following completely
- hangs zsh 2.2.0 - it will even manage to ignore SIGHUP and SIGABRT:
-
- gd:~> read foo bar baz
- a
-
- Note that if I change "a" to "a b", it works fine. Does anyone knows a way
- around this bug. Or better yet, can suggest how I can avoid this read
- alltogether in my .zprofile. The following script is supposed to set DISPLAY
- environment variable for me automatically when I login from X. It also chooses
- X defaults depending on weather the server has color display. After klunging
- above bug by adding garbage to input for read, it works fine but too slow. Any
- suggestions? -- Thanks!
-
- Oleg
-
- resolve() # Finger will strip long hostname, so I have to fix domain.
- {
- IFS='.: ' read host dom misc
- if ( [ "$dom" = "cs" ] ) {
- echo ${host}.cs.CSUFresno.EDU:0.0
- } else {
- echo ${host}.CSUFresno.EDU:0.0
- }
- }
-
- if( [ \( .$TERM = .network \) -o \( .$TERM = .unknown \) -o \( .$TERM = . \) ]
- ) {
- export TERM=vt100
- stty rows 42 cols 132
- } elif ( [ .$DISPLAY = . ] ) {
- export DISPLAY=`finger -swf oleg | awk 'NF == 5 {printf("%s.cs.CSUFresno.EDU\n",$NF) ;exit}' | resolve`
- }
-
- if( [ .`fgrep -i "$DISPLAY" ~/.color` != . ] ) {
- export XENVIRONMENT=.Xdefaults.color
- } else {
- export XENVIRONMENT=.Xdefaults
- }
-
- unfunction resolve
- newfrom
- biff y
- trap "clear; /usr/games/fortune; exit" 0
-