Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Two esoteric zsh questions
- X-seq: zsh-users 3414
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Jerry Peek <jpeek@xxxxxxxxx>, zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Two esoteric zsh questions
- Date: Fri, 8 Sep 2000 15:25:51 -0700
- In-reply-to: <24818.968185312@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <24818.968185312@xxxxxxxxx>
On Sep 5, 1:21pm, Jerry Peek wrote:
>
> (Is *any* zsh question esoteric? Or are *all* zsh questions? ;-)
Both.
> 1) Can anyone explain the difference in the following two cases? The
> first sets a shell variable; the second sets an environment variable.
Zefram answered this.
> 2) I wanted to compare the values of $whoson and $WHOSON.
You mean you wanted to see the differences, not just know whether there
are differences? When I hear "compare the values" I think of
[[ $whoson == $WHOSON ]]
> I couldn't think of a way to use two <<< operators
Right; if you did so, multios would concatenate the two inputs.
> % diff - <(echo $WHOSON) <<<$whoson
> %
>
> Does anyone know a cleaner way to do that?
Aside from using "print -r --" in place of "echo", so that backslashes or
leading hyphens in $WHOSON won't cause problems, the only thing that comes
to mind is
diff <(<<<$whoson) <(<<<$WHOSON)
which is really mostly same as
> % diff - <(cat <<<$WHOSON) <<<$whoson
except that zsh implements the "cat" internally, and you can give the args
in the same order that they'll appear in the diff output, which is slightly
more understandable.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author