Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!mips!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!uw-beaver!zephyr.ens.tek.com!orca.wv.tek.com!quark!jeff From: jeff@quark.WV.TEK.COM (Jeff Beadles) Newsgroups: comp.unix.shell Subject: Re: Yet Another bourne shell query Message-ID: <8478@orca.wv.tek.com> Date: 31 Aug 90 14:59:35 GMT References: <437@minya.UUCP> Sender: news@orca.wv.tek.com Reply-To: jeff@quark.WV.TEK.COM (Jeff Beadles) Organization: Tektronix, Inc., Wilsonville, OR Lines: 29 jc@minya.UUCP (John Chambers) writes: >I basically want to write something like: > if [ ];then execbut I don't know what to put between the [ and the ]. Any ideas? >Is it possible? Or should I just rewrite the scripts in C? Well, from the test(1) man page... -t [ fildes ] True if the open file whose file descriptor number is fildes (1 by default) is associated with a terminal device. This, you can tell if a file descriptor is attached to a terminal. (It will fail for a pipe or redirection) Thus, something like this might be what you are looking for: if [ -t 0 ] ; then exec