Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!uunet!munnari.oz.au!uniwa!DIALix!metapro!bernie From: bernie@metapro.DIALix.oz.au (Bernd Felsche) Newsgroups: comp.unix.shell Subject: Re: HOW do you tell KSH is interactive ? Message-ID: <1991Mar5.035646.21368@metapro.DIALix.oz.au> Date: 5 Mar 91 03:56:46 GMT References: <6178@mentor.cc.purdue.edu> <5864@iron6.UUCP> <1991Feb26.041034.15149@metapro.DIALix.oz.au> <1991Feb28.183809.23891@noose.ecn.purdue.edu> Organization: MetaPro Systems, Perth, Western Australia Lines: 26 In <1991Feb28.183809.23891@noose.ecn.purdue.edu> luj@gus17.ecn.purdue.edu (Jun Lu) writes: >In article <1991Feb26.041034.15149@metapro.DIALix.oz.au> bernie@metapro.DIALix.oz.au (Bernd Felsche) writes: >>You could test to see if stdin is connceted to a tty! >> >>[ -t 0 ] && echo interactive >Incorrect. You can easily see this by putting this line in a script file. Now, if I hadn't tried it, I wouldn't have suggested it! It works for me, and has worked interactively, and via a script. Now, if your standard input is altered, even by you putting the script in background (making it non-interactive) then the message won't be printed. Maybe you have a broken ksh? The one I have came with SVR3.2/68k from Motorola. As a matter of fact, it even works with the Bourne shell we have (as it should, because it's a standard test function). Can you tell me what I'm doing right? :-) -- Bernd Felsche, _--_|\ #include Metapro Systems, / sale \ Fax: +61 9 472 3337 328 Albany Highway, \_.--._/ Phone: +61 9 362 9355 Victoria Park, Western Australia v Email: bernie@metapro.DIALix.oz.au