Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: LINENO behaviour in sh mode
- X-seq: zsh-workers 40881
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Martijn Dekker <martijn@xxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: LINENO behaviour in sh mode
- Date: Wed, 22 Mar 2017 19:45:27 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=F2kIXDUbsnOJOvWm/vdmV+WSLYvUGbBO/2ev6o3dr9g=; b=k7PeizoPskY1nPtRZTUob2mIHeCFIcHrYfseJR9n5ecs+Nz3HcP47Dz+dBH00fnkNX brBH6yWrJ5lCQniz8N7Nkkx9ducpqij3PjxJriUxggV0OaDhN/VxrLByS0bMyekAPdM6 sROtkI+Al+dOi0rdbiuIGOkFgARxDs1wmZKCHBPIqjMBDhvtguOknrjYI8BkqvfQsXpN p6ijIZjQ8wewQMg38IG4Z49dlpiDvCavrHOYevIcP+7N54tkygkAjZd5O5t9P6BWQPTn Kx7G41ujiUg//z+ggWsQeGjCv1R5cFsptvk9iRXuAlPgcihwJhMhDPkjuRb2xRUCgd4R PeMg==
- In-reply-to: <f3458567-3d11-eada-ea2a-6f88f9b64a9b@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <f3458567-3d11-eada-ea2a-6f88f9b64a9b@inlv.org>
On Mar 20, 3:57am, Martijn Dekker wrote:
}
} Output on various shells:
} bash: 1 2 5 6 7 6 (?!)
Clearly bash is incrementing LINENO through the parse of the eval and
then continuing to increment it through the execution.
I'm mildly surprised that no shell prints "1 2 3 4 5 6".
} zsh (sh): 1 2 3 3 3 6 (like ksh88)
}
} Since ksh88 is dead and buried (even Solaris now has ksh93 as their
} /bin/sh), it looks like zsh's "sh" mode is not emulating any current sh.
} Maybe 'emulate sh' should no longer turn off the EVAL_LINENO option.
You're forgetting about the second effect of this, which is to print
"(eval)" in xtrace output instead of the script or function name. Try
your test again with "set -x" ... Do we need a separate option?
Also, how should the doc be updated, given that csh emulation would
become the outlier?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author