zsh-users
 help / color / mirror / code / Atom feed
* How to create unnamed temporary arrays?
@ 2001-02-19  9:52 Hannu Koivisto
  2001-02-19  9:55 ` Sven Wischnowsky
  0 siblings, 1 reply; 10+ messages in thread
From: Hannu Koivisto @ 2001-02-19  9:52 UTC (permalink / raw)
  To: Zsh Users' List

Greetings,

I'm currently using something like this to list the base names of
files in /usr/local/etc/packages/ directory, each name on its own
line:

echo ${(F)$(echo /usr/local/etc/packages/*(.:t:r))}

This has the obvious problem that it doesn't work if filenames have
spaces in them.  I just couldn't figure out any way to do something
corresponding to:

kala=(/usr/local/etc/packages/*(.:t:r))
echo ${(F)kala}

without creating that temporary array variable.  Not that this
really matters in this case, but I've faced situations earlier
where avoiding the temporary name might have been more convenient
and now I finally have a simple enough example to demonstrate it.

So, is there a way?  I'm using zsh versions 3.1.9-dev-6 and
3.1.9-dev-8 from Debian GNU/Linux testing/unstable and stable,
respectively.

-- 
Hannu
Please don't send copies of list mail


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

end of thread, other threads:[~2001-02-27  8:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19  9:52 How to create unnamed temporary arrays? Hannu Koivisto
2001-02-19  9:55 ` Sven Wischnowsky
2001-02-20 18:02   ` Hannu Koivisto
2001-02-20 18:38     ` Andrej Borsenkow
2001-02-26  6:38       ` Bart Schaefer
2001-02-21  6:56     ` Thomas Köhler
2001-02-22  6:01       ` Andrej Borsenkow
2001-02-23 10:48         ` Stop _path_files from searching / Christoph Lange
2001-02-23 12:15           ` Andrej Borsenkow
2001-02-26  8:26             ` Christoph Lange

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