Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zpty woes
- X-seq: zsh-workers 25035
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Jaime Vargas <jev@xxxxxxx>
- Subject: Re: zpty woes
- Date: Thu, 15 May 2008 14:10:42 +0100
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <34AE8142-F5DA-44FD-96BA-61BDE12BC74E@xxxxxxx>
- Mail-followup-to: Jaime Vargas <jev@xxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <34AE8142-F5DA-44FD-96BA-61BDE12BC74E@xxxxxxx>
On Thu, May 15, 2008 at 08:02:04AM -0400, Jaime Vargas wrote:
[...]
> zpty -t scppty || echo "something went wrong" && exit
[...]
That would always exit unless echo returned with a non-zero exit
status
A || B && C
must be read
(A || B) && C
So C is executed if either A or B succeeds.
You should write it:
A || {
B
C
}
or
if ! A; then
B
C
fi
or
die() {print -r -- $1 >&2; exit 1;}
A || die "something wrong"
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author