zsh-workers
 help / color / mirror / code / Atom feed
* Re: Z-Shell Frequently-Asked Questions (monthly posting)
       [not found] <26983.9506231110@pyro.swan.ac.uk>
@ 1995-06-28 19:16 ` Zoltan Hidvegi
  1995-06-28 19:56   ` Richard Coleman
  1995-06-29 10:02   ` P.Stephenson
  0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Hidvegi @ 1995-06-28 19:16 UTC (permalink / raw)
  To: zsh-workers

> B1) Differences from sh and ksh
> ...
>   Command line substitutions, globbing etc.:

Just one addition here: foo=* assignment assigns the list of files in the
current directory as an array to foo if there are at least two matches, or if
there is a single file in the directory, foo becames a scalar whose value is
the name of that file. Other Bourne shells does not glob the right hand side
of assignments. In my releases the default behaviour is to not glob here, but
this can be changed by setting the GLOB_ASSIGN option.

>     The $((...)) version of numeric evaluation was not available before
>       version 2.6 (use $[...]).

And even in vanila 2.6 $((...)) is done after fork, hence if used as an
argument to an external program, assignments inside $((...) has no effect. Of
course this bug is also fixed in my release.

>     Treatment of backslashes within backquotes is subtly different.

I still do not know about such differences. I use zsh as /bin/sh without
probles, so there are probably no differences. Either remove that not, or give
an example.

>     $PSn do not do parameter substitution by default (use PROMPT_SUBST).

And even if PROMPT_SUBST is set, things like ${foo#*bar} does not work
properly in prompts. Thats also fixed in my release.

>   However, zsh has no claims towards Posix compliancy and will not use

Could anyone tell me how zsh differs from POSIX if invoked as sh?

There is an other thing where zsh differs from e.g. bash: characters in the
range 0x80-0x9b (or may be between 0x80-0x9f) cannot be used in scripts and
such characters in backquote or parameter substitutions are discarded (or
interpreted in a completely wrong way). That because these are used for
tokenization, hence to fix it, major parts of zsh would have to be rewritten.

>   ...
>   Of course, this makes zsh rather large and quite messy so that it

But zsh is only a little bit larger than bash or tcsh, and it seems to use
much less memory and CPU time than tcsh.

Cheers,
  Zoltan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Z-Shell Frequently-Asked Questions (monthly posting)
  1995-06-28 19:16 ` Z-Shell Frequently-Asked Questions (monthly posting) Zoltan Hidvegi
@ 1995-06-28 19:56   ` Richard Coleman
  1995-06-29 10:02   ` P.Stephenson
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Coleman @ 1995-06-28 19:56 UTC (permalink / raw)
  To: zsh-workers

> Just one addition here: foo=* assignment assigns the list of files in the
> current directory as an array to foo if there are at least two matches, or if
> there is a single file in the directory, foo becames a scalar whose value is
> the name of that file. Other Bourne shells does not glob the right hand side
> of assignments. In my releases the default behaviour is to not glob here, but
> this can be changed by setting the GLOB_ASSIGN option.
> 
> >     The $((...)) version of numeric evaluation was not available before
> >       version 2.6 (use $[...]).
> 
> And even in vanila 2.6 $((...)) is done after fork, hence if used as an
> argument to an external program, assignments inside $((...) has no effect. Of
> course this bug is also fixed in my release.

Both of these will be fixed in the baseline before the production release.  I
haven't forgotten about them.  Whether you believe this or not, I've been
working on zsh 6 or 7 days a week.  I may not be fast, but I try to do things
right.

Richard Coleman
coleman@math.gatech.edu


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Z-Shell Frequently-Asked Questions (monthly posting)
  1995-06-28 19:16 ` Z-Shell Frequently-Asked Questions (monthly posting) Zoltan Hidvegi
  1995-06-28 19:56   ` Richard Coleman
@ 1995-06-29 10:02   ` P.Stephenson
  1995-06-29 11:20     ` Zoltan Hidvegi
  1 sibling, 1 reply; 4+ messages in thread
From: P.Stephenson @ 1995-06-29 10:02 UTC (permalink / raw)
  To: Zsh hackers list

hzoli@cs.elte.hu wrote:
> > B1) Differences from sh and ksh
> > ...
> >   Command line substitutions, globbing etc.:
> 
> Just one addition here: foo=* assignment assigns the list of files in the
> current directory as an array to foo if there are at least two matches, or if
> there is a single file in the directory, foo becames a scalar whose value is
> the name of that file. Other Bourne shells does not glob the right hand side
> of assignments. In my releases the default behaviour is to not glob here, but
> this can be changed by setting the GLOB_ASSIGN option.

I agree this is a little inconsistent.  What about `foo=(*)', though?
I use that kind of thing a lot, and it seems obvious to me that it
should always do globbing --- at least, I tend to think of arguments
of an array assignment behaving like command line arguments as far as
word splitting is concerned.  Perhaps it's not obvious to others.  (I
can do `set -A' but I like assignments to look like assignments.)

> >     Treatment of backslashes within backquotes is subtly different.
> 
> I still do not know about such differences.

I think they've now disappeared, though I don't know when that
happened:  certainly some pretty grotesque constructions now do the
same in zsh as the other shells.  I meant to delete this line.

-- 
Peter Stephenson <P.Stephenson@swansea.ac.uk>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Z-Shell Frequently-Asked Questions (monthly posting)
  1995-06-29 10:02   ` P.Stephenson
@ 1995-06-29 11:20     ` Zoltan Hidvegi
  0 siblings, 0 replies; 4+ messages in thread
From: Zoltan Hidvegi @ 1995-06-29 11:20 UTC (permalink / raw)
  To: zsh-workers

P.Stephenson@swansea.ac.uk wrote:
> hzoli@cs.elte.hu wrote:
> > > B1) Differences from sh and ksh
> > > ...
> > >   Command line substitutions, globbing etc.:
> > 
> > Just one addition here: foo=* assignment assigns the list of files in the
> > current directory as an array to foo if there are at least two matches, or if
> > there is a single file in the directory, foo becames a scalar whose value is
> > the name of that file. Other Bourne shells does not glob the right hand side
> > of assignments. In my releases the default behaviour is to not glob here, but
> > this can be changed by setting the GLOB_ASSIGN option.
> 
> I agree this is a little inconsistent.  What about `foo=(*)', though?
> I use that kind of thing a lot, and it seems obvious to me that it
> should always do globbing --- at least, I tend to think of arguments
> of an array assignment behaving like command line arguments as far as
> word splitting is concerned.  Perhaps it's not obvious to others.  (I
> can do `set -A' but I like assignments to look like assignments.)

Of course I agree, that foo=(*) should do globbing. That's the right way to do
it. I did not change that in my release, moreover I recommend its usage in the
manual.

Zoltan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-06-29 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <26983.9506231110@pyro.swan.ac.uk>
1995-06-28 19:16 ` Z-Shell Frequently-Asked Questions (monthly posting) Zoltan Hidvegi
1995-06-28 19:56   ` Richard Coleman
1995-06-29 10:02   ` P.Stephenson
1995-06-29 11:20     ` Zoltan Hidvegi

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).