Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Two esoteric zsh questions



(Is *any* zsh question esoteric?  Or are *all* zsh questions? ;-)
Here's a question that might be a bug, then a follow-up "how to".
I'm using 3.0.7 on Linux (Red Hat 6.2) right now.

----------------------------------------------------------------------

1) Can anyone explain the difference in the following two cases?  The
first sets a shell variable; the second sets an environment variable.
In the second, I have to quote the `who`:

	% whoson=`who`
	%

	% export WHOSON=`who`
	zsh: not an identifier: 06:56
	% export WHOSON="`who`"
	%

(The first line of the "who" output ends with 06:56.)

I looked through the FAQ and scanned through a change list... but
didn't spot changes in more recent versions, so I'm asking the list.
Is the difference a bug, side effect, or feature?

----------------------------------------------------------------------

2) I wanted to compare the values of $whoson and $WHOSON.  I couldn't
think of a way to use two <<< operators, so I tried this kludge:

	% diff - <(echo $WHOSON) <<<$whoson
	%

Does anyone know a cleaner way to do that?

[BTW, this next mess wasn't as simple but it worked fine too:

	% diff - <(cat <<<$WHOSON) <<<$whoson

zsh is amazing...]

----------------------------------------------------------------------

Thanks!

--Jerry Peek, jpeek@xxxxxxxxx
  http://www.jpeek.com/

PS: I mentioned last spring that the third edition of Unix Power Tools
will cover zsh -- and asked if the new shell would be ready by August
so we could put it on the book's CD-ROM.  FYI, due to some scheduling
problems, I'm still working on the book; the target date is early 2001.)



Messages sorted by: Reverse Date, Date, Thread, Author