[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exit upon first error?
From: |
Ludovic Courtès |
Subject: |
Re: exit upon first error? |
Date: |
Wed, 09 May 2007 10:26:09 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Hi,
David Fang <address@hidden> writes:
> Is there a way to force guile to exit upon first error (uncaught
> dynwind), analogous to "sh -e"? Though this isn't something one would
> want interactively, it might be useful for non-interactive scripts to bail
> out as soon as something goes wrong, rather than continue generating
> errors. Thanks in advance.
AFAIK, the only way to achieve this is by calling `exit':
$ guile -c '(exit (begin #f))' ; echo $?
1
It converts `#f' to a non-zero exit value and anything else to zero.
Hope this helps,
Ludovic.