From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12286 invoked from network); 5 Apr 1998 14:34:03 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 5 Apr 1998 14:34:03 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id KAA13158; Sun, 5 Apr 1998 10:31:47 -0400 (EDT) Resent-Date: Sun, 5 Apr 1998 10:27:58 -0400 (EDT) Date: Sun, 5 Apr 1998 16:27:29 +0200 (MET DST) From: "C. v. Stuckrad" X-Sender: stucki@petzval Reply-To: "C. v. Stuckrad" To: Michael Barnes cc: Timothy J Luoma , zsh-users@math.gatech.edu Subject: Re: why does this exit = 1 ? In-Reply-To: Message-ID: X-TestHeaderA: Written by C. v. Stuckrad; FB. Mathematik; EDV X-TestHeaderB: FU-Berlin; Arnimallee 2-6; 14195 Berlin; GERMANY Priority: normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"xwaZ61.0.VC3.jJv9r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1439 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu strange thou, it works for me, tested it in a zsh-function! I did try() { if [ ! -r ... ] then echo no file fi } and tested with 'try; echo $?' and file or no file the result was 0 (on zsh or sh; Sun or LINUX(where sh==bash) So what does happen really ? Stucki On Sun, 5 Apr 1998, Michael Barnes wrote: > Subject: Re: why does this exit = 1 ? > Date: Sun, 5 Apr 1998 04:22:20 -0400 (EDT) > > The if statement returns false so the script returns false (1), > if you want the script to return true just add exit 0 at the end. ... > On Sun, 5 Apr 1998, Timothy J Luoma wrote: > > I have this little snippet: > > ... > > if [ -r /LocalLibrary/Images/Icons/tempPark.tiff -a ! -r /tmp/.dir.tiff ] then > > ln -s /LocalLibrary/Images/Icons/tempPark.tiff /tmp/.dir.tiff > > fi > > > > When I run it and there is already a /tmp/.dir.tiff it exits = 1 Christoph von Stuckrad * * | talk to | \ Freie Universitaet Berlin |/_* | nickname | ...!unido!fub!leibniz!stucki| Fachbereich Mathematik, EDV |\ * | 'stucki' | Tel:+49 30 838-75459 | Arnimallee 2-6/14195 Berlin * * | on IRC | Fax:+49 30 838-75454 /