Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.unix.questions Subject: Re: Piping into Shell scripts Message-ID: Date: 7 Mar 90 16:56:52 GMT References: <1990Feb28.142050.11607@virtech.uucp> <10650083@hpisod2.HP.COM> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 13 > > >Is there any way of getting a Shell script (C or Bourne) to recognise > > >whether it is receiving input from a pipe? ... bunch of non-optimal answers deleted ... if [ -t 0 ] then echo "Standard Input is a terminal" else echo "Standard input is not a terminal" fi Often, test ("[...]") is a builtin, saving you a fork/exec. -- _--_|\ `-_-' Peter da Silva. +1 713 274 5180. . / \ 'U` \_.--._/ v