Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!spool.mu.edu!uunet!hsi!hsi86!mark From: mark@hsi86.hsi.com (Mark Sicignano) Newsgroups: comp.unix.questions Subject: return code fun! Message-ID: <3074@hsi86.hsi.com> Date: 12 Feb 91 21:07:25 GMT Reply-To: mark@hsi.com kenney@hsi.com schaller@hsi.com ross@hsi.com Distribution: usa Organization: 3M Health Information Systems, Wallingford, CT. Lines: 34 Let me just show you... $ false $ echo $? 1 $ false ; echo $? 1 $ false | echo $? 0 Ok... so the $? must be from the previously executed command, which is the previous echo, which returned 0? So, this should print 1? $ false $ false | echo $? 0 wrong... What is this 0 return status coming from? The pipe? When a pipe is created, does the shell set $? depending on whether or not the pipe was successful? Don't tell me that "false | echo $?" has no useful purpose. I know that!!!! I'm just trying to use it as a simple example! -mark -- Mark Sicignano ...!uunet!hsi!mark 3M Health Information Systems mark@hsi.com