zsh-users
 help / color / mirror / code / Atom feed
* Problem with glob qualifier e
@ 2005-09-05 16:32 Hannu Koivisto
  2005-09-05 17:22 ` Andrey Borzenkov
  2005-09-05 18:39 ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Hannu Koivisto @ 2005-09-05 16:32 UTC (permalink / raw)
  To: Zsh Users' List

Greetings,

The manual of zsh 4.2.1 says the following about the glob qualifier
e:

     filename.  In addition, the parameter reply may be set to an array
     or a string, which overrides the value of REPLY.  If set to an
     array, the latter is inserted into the command line word by word.

     For example, suppose a directory contains a single file
     `lonely'.  Then the expression `*(e:'reply=(${REPLY}{1,2})':)'
     will cause the words `lonely1 lonely2' to be inserted into the
     command line.

I can verify that the example works as described.  But I don't
understand how to extend that to more complex cases.

For instance, let's say that I would like to splice two command
line arguments after each file argument produced by a glob pattern.
If I have files sur and pur in the current directory, I would like
to say something along the lines of

echo (sur|pur)(e:'<something>':)

which, when expanded, should result to

echo pur -foo bar sur -foo bar

I expected

echo (sur|pur)(e:'reply=(${REPLY} -foo bar)':)

to do what I want but instead that results to

echo -foo -foo bar bar pur sur

I can't see how that follows from the quoted documentation.  In any
case, if my goal cannot be achieved with the glob qualifier e, is
there some other brief trick to modify the list of generated
filenames in such a way?

-- 
Hannu


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

end of thread, other threads:[~2005-09-06 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-05 16:32 Problem with glob qualifier e Hannu Koivisto
2005-09-05 17:22 ` Andrey Borzenkov
2005-09-05 19:05   ` Bart Schaefer
2005-09-06  2:51     ` Andrey Borzenkov
2005-09-06 13:58       ` Bart Schaefer
2005-09-05 18:39 ` Bart Schaefer

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