Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!think!mintaka!mit-eddie!bu.edu!dartvax!coat.com From: andyb@coat.com (Andy Behrens) Newsgroups: comp.unix.wizards Subject: Re: Which is more portable: stty < or stty > Message-ID: <20539@dartvax.Dartmouth.EDU> Date: 13 Mar 90 21:16:24 GMT References: <3354@muffin.cme.nist.gov> <12339@smoke.BRL.MIL> Sender: news@dartvax.Dartmouth.EDU Reply-To: andyb@coat.com Organization: Burlington Coat Factory Warehouse Lines: 28 In article jv@mh.nl (Johan Vromans) writes: > > [On the topic of using stdin or stdout for stty(1): System V assumes you may > want to redirect the output somewhere other than the terminal being probed.] > > This seems quite logical to me, considering things like > > STTY_FLAGS=`stty -g < /dev/tty` > sane() { stty ${STTY_FLAGS}; } > > You can't do this from your BSD .login . You can certain capture the stty output in a variable. BSD stty probes stdout (not stdin), but it writes to stderr (not stdout). So you could write STTY_OUTPUT=`stty 2>&1 >/dev/tty` Of course, BSD doesn't support 'stty -g', but that's another issue. -- Live justly, love gently, walk humbly. Andy Behrens andyb@coat.com uucp: {uunet,rutgers}!dartvax!coat.com!andyb Burlington Coat, PO Box 729, Lebanon, N.H. 03766 (603) 448-5000