zsh-users
 help / color / mirror / code / Atom feed
From: "C. v. Stuckrad" <stucki@math.fu-berlin.de>
To: Michael Barnes <mibarnes@mail.vth.vt.edu>
Cc: Timothy J Luoma <luomat+Lists/Zsh/users@luomat.peak.org>,
	zsh-users@math.gatech.edu
Subject: Re: why does this exit = 1 ?
Date: Sun, 5 Apr 1998 16:27:29 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.GSO.3.95q.980405161554.11045B-100000@petzval> (raw)
In-Reply-To: <Pine.LNX.3.95.980405041927.14698A-100000@mail.vth.vt.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  | <stucki@math.fu-berlin.de> \
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       /


  reply	other threads:[~1998-04-05 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-05  8:00 Timothy J Luoma
1998-04-05  8:22 ` Michael Barnes
1998-04-05 14:27   ` C. v. Stuckrad [this message]
1998-04-09  5:50     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.3.95q.980405161554.11045B-100000@petzval \
    --to=stucki@math.fu-berlin.de \
    --cc=luomat+Lists/Zsh/users@luomat.peak.org \
    --cc=mibarnes@mail.vth.vt.edu \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).