Path: utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: Re: End-of-file character (was script > mumble) Message-ID: <1503@fireball.cs.vu.nl> Date: 10 Oct 88 19:32:22 GMT References: <4975@saturn.ucsc.edu> <503@quintus.UUCP> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 19 In article <503@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: \... here's some source code: [C source deleted] People, what happened to good old shell script programming? BSD: sh -c 'stty all 2> /tmp/stty.$$; set `tail -1 /tmp/stty.$$`; shift; shift; echo $9; /bin/rm /tmp/stty.$$' ---------------------------------------------------------------------------- SysV: sh -c 'stty -a | sed -e "s/.*eof = \([^;]*\).*/\1/" -e q' ---------------------------------------------------------------------------- BTW, this shows the SysV stty(1) command is favorable in one way: if stdout isn't a tty, try stderr or stdin! (So we won't need the stupid temp file.) -- Hippic sport: |Maarten Litmaath @ Free U Amsterdam: a contradiction in terms.|maart@cs.vu.nl, mcvax!botter!maart