zsh-users
 help / color / mirror / code / Atom feed
* globbing and parameter expansion in 3.0.5
@ 1998-08-31 15:55 Stefan Monnier
  1998-09-01  9:19 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 1998-08-31 15:55 UTC (permalink / raw)
  To: zsh-users


There is a discrepency between bash and zsh when it comes to mixing parameter
expansion and globbing:

/-0% bash -c 'toto="*"; echo $toto'
System.map amd bin boot cdrom compressed core depots dev dos etc floppy home homes inittab kernel lib lost+found misc mnt net nfs proc root rpm sbin scratch softs tmp usr var windows wine
/-0% zsh -c 'toto="*"; echo $toto'
*
/-0% 

To me, bash behavior looks more consistent (since 'echo $foo/*' does the
parameter expansion before globbing), but compctl-examples seem to indicate
that at least the guy who wrote the man_glob function already knew about this
pecularity.

Which one is "correct" ?


	Stefan


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

* Re: globbing and parameter expansion in 3.0.5
  1998-08-31 15:55 globbing and parameter expansion in 3.0.5 Stefan Monnier
@ 1998-09-01  9:19 ` Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1998-09-01  9:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: zsh-users

Stefan Monnier wrote:
>/-0% bash -c 'toto="*"; echo $toto'
>System.map amd bin boot cdrom compressed core depots dev dos etc floppy home homes inittab kernel lib lost+found misc mnt net nfs proc root rpm sbin scratch softs tmp usr var windows wine
>/-0% zsh -c 'toto="*"; echo $toto'
>*

% zsh -c 'toto="*"; echo $toto'
*
% zsh -c 'toto="*"; echo $~toto'
bin data etc export man tmp usr
% ARGV0=sh zsh -c 'toto="*"; echo $toto'
bin data etc export man tmp usr
% ARGV0=bash zsh -c 'toto="*"; echo $toto'
bin data etc export man tmp usr

>Which one is "correct" ?

Both.  See GLOB_SUBST in zshoptions(1).

-zefram


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

end of thread, other threads:[~1998-09-01  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-31 15:55 globbing and parameter expansion in 3.0.5 Stefan Monnier
1998-09-01  9:19 ` Zefram

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