Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!agate!violet.berkeley.edu!ilan343 From: ilan343@violet.berkeley.edu Newsgroups: comp.unix.questions Subject: Return values in pipelines Message-ID: <1990Aug22.211057.19850@agate.berkeley.edu> Date: 22 Aug 90 21:10:57 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Organization: University of California, Berkeley Lines: 11 The /bin/sh (and the ksh) set the parameter ? to the return value of the last excuted command. When I use a number of piped commands, say prog1 | prog2 | prog3 , $? is set to the return value of the last command in the pipeline (prog3) . How can I detect if something went wrong on the previous commands in the pipeline (prog2, prog3)? Geraldo Veiga