From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: Comprehensive comparison between zsh and bash
Date: Fri, 5 Jul 2019 22:31:06 -0400 [thread overview]
Message-ID: <20190706023105.GA2314@spodhuis.org> (raw)
In-Reply-To: <7aeeabc8-0375-1793-c8a0-1b3af235f1d0@eastlink.ca>
On 2019-07-05 at 13:29 -0700, Ray Andrews wrote:
> Just curious: Is there some way of dumping the state of all variables at
> all lines with both bash and zsh to some file or other such that one could
> quickly spot exactly when and where something might change between them?
> Not a proactive, analytic study of the code, but just a pragmatic finding of
> differences after the fact.
`typeset -p` dumps all variables; the format differs slightly between
shells but that's light text-munging to normalize.
This is probably a good start:
trap 'typeset -p' DEBUG
although I'm not going to promise that the DEBUG hook is invoked in
exactly the same circumstances in each shell. But that should get you
going. It will be voluminous.
You might consider:
mkdir -m 0700 -p "$HOME/traces"
exec 4>"$HOME/traces/$$.log"
trap 'typeset -p >&4' DEBUG
You could use `set -x` too, to see the commands being run, but while
bash has `BASH_XTRACEFD`, I don't think zsh has anything quite like
that. So you're going to lose stderr, or accept differences.
-Phil
next prev parent reply other threads:[~2019-07-06 2:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 20:01 Peng Yu
2019-07-05 20:21 ` Eric Cook
2019-07-05 20:29 ` Ray Andrews
2019-07-06 2:31 ` Phil Pennock [this message]
2019-07-06 14:23 ` Ray Andrews
2019-07-06 12:31 ` Sebastian Gniazdowski
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=20190706023105.GA2314@spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/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).