🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81854

Re: mailpost exits with 0 when it should not

#81854
From: Ray Banana
Date: Wed, 02 Sep 2009 13:43
24 lines
2161 bytes
* Jon Bendtsen wrote:
> Ray Banana wrote:
>>> cat "$post" | /usr/lib/news/bin/mailpost -a approved $group && rm
>>> "$post"
>>> So it should ONLY delete mails that was successfully posted, which
>>> leads to mailpost should not return 0 when there was an error.
>> It's not the return code from mailpost that triggers the rm command,
>> but the return code from cat and cat was successful.
> Are you sure about that?
> 	true | false && echo "hello world"
> gives no output, where as
> 	false | true && echo "hello world"
> does give output

Oops, sorry, my bad:

from man bash:

| The return status of a pipeline is the exit status of the last command,
| unless the pipefail option is enabled.

-- 
Too many ingredients in the soup, no room for a spoon
http://www.eternal-september.org
Technical Details
Message-ID: <slrnh9stj4.h6d.rayban@banana.shacknet.nu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder2.news.weretis.net!feeder.eternal-september.org!eternal-september.org!news.eternal-september.org!not-for-mail
References: <h7lkqm$947$1@munin.diku.dk> <slrnh9sn2v.jut.rayban@banana.shacknet.nu> <h7loog$aae$2@munin.diku.dk>

Show Full Headers
Complete Article Headers
Message-ID: <slrnh9stj4.h6d.rayban@banana.shacknet.nu>
Subject: Re: mailpost exits with 0 when it should not
Date: Wed, 02 Sep 2009 13:43:00 +0000
From: Ray Banana <rayban@banana.shacknet.nu>
References: <h7lkqm$947$1@munin.diku.dk> <slrnh9sn2v.jut.rayban@banana.shacknet.nu> <h7loog$aae$2@munin.diku.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder2.news.weretis.net!feeder.eternal-september.org!eternal-september.org!news.eternal-september.org!not-for-mail
Newsgroups: news.software.nntp
Organization: A noiseless patient Spider
Lines: 24
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org
 U2FsdGVkX1+2qnC2zaHSq21ZsSRNnYzxlfmW7wO5+EU7U0Xt/MV+m2aFtwA3Cr2XrOsep+aSSBKC9+yrYNRetNRb5ZcEQMhmlpReAEkwpQpVeQ9V3raT8azSK+lIfnaiXepaE0rZPECgA7CFFl5YEAwX1VuOtLM5
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Wed, 2 Sep 2009 13:43:00 +0000 (UTC)
X-Auth-Sender: U2FsdGVkX18DDHnNhOxOZ4vDAJxmGE5m00Kh8Zjq2eI20KymI1pSRg==
Cancel-Lock: sha1:/HNJXL57TP3APZAyk/wycWwNLVc=
User-Agent: slrn/0.9.9 (Linux)