* kinda perl grep ?
@ 2006-03-07 15:35 Marc Chantreux
2006-03-07 15:44 ` Peter Stephenson
2006-03-07 15:45 ` Clint Adams
0 siblings, 2 replies; 5+ messages in thread
From: Marc Chantreux @ 2006-03-07 15:35 UTC (permalink / raw)
To: zsh-users
Hi all,
in perl , i write :
@files = grep { chomp; -f $_ } `dpkg -L libapache2-mod-perl2`
in zsh :
for f ( $(dpkg -L libapache2-mod-perl2 ) ) { [[ -f $f ]] && files+=$f }
i dream about something like
files=( ${$(dpkg -L libapache2-mod-perl2):[[ -f $_ ]]} )
or something like
arraygrep '-f $_ ' $(dpkg -L libapache2-mod-perl2)
someone to make the dream come true ?
regards
mc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kinda perl grep ?
2006-03-07 15:35 kinda perl grep ? Marc Chantreux
@ 2006-03-07 15:44 ` Peter Stephenson
2006-03-07 15:45 ` Clint Adams
1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2006-03-07 15:44 UTC (permalink / raw)
To: Zsh users list
> Hi all,
> in perl , i write :
>
> @files = grep { chomp; -f $_ } `dpkg -L libapache2-mod-perl2`
>
> in zsh :
>
> for f ( $(dpkg -L libapache2-mod-perl2 ) ) { [[ -f $f ]] && files+=$f }
>
> i dream about something like
>
> files=( ${$(dpkg -L libapache2-mod-perl2):[[ -f $_ ]]} )
files=( ${^$(dpkg -L libapache2-mod-perl2)}(N.) )
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kinda perl grep ?
2006-03-07 15:35 kinda perl grep ? Marc Chantreux
2006-03-07 15:44 ` Peter Stephenson
@ 2006-03-07 15:45 ` Clint Adams
2006-03-07 17:25 ` Bart Schaefer
1 sibling, 1 reply; 5+ messages in thread
From: Clint Adams @ 2006-03-07 15:45 UTC (permalink / raw)
To: Marc Chantreux; +Cc: zsh-users
> files=( ${$(dpkg -L libapache2-mod-perl2):[[ -f $_ ]]} )
files=( ${^$(dpkg -L libapache2-mod-perl2)}(N.) )
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kinda perl grep ?
2006-03-07 15:45 ` Clint Adams
@ 2006-03-07 17:25 ` Bart Schaefer
2006-03-08 14:58 ` Marc Chantreux
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2006-03-07 17:25 UTC (permalink / raw)
To: zsh-users
On Mar 7, within 30 seconds of each other, PWS and Clint both wrote:
}
} > files=( ${$(dpkg -L libapache2-mod-perl2):[[ -f $_ ]]} )
}
} files=( ${^$(dpkg -L libapache2-mod-perl2)}(N.) )
Or more generally,
files=( ${^$(dpkg -L libapache2-mod-perl2)}(e:'[[ -f $REPLY ]]':) )
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kinda perl grep ?
2006-03-07 17:25 ` Bart Schaefer
@ 2006-03-08 14:58 ` Marc Chantreux
0 siblings, 0 replies; 5+ messages in thread
From: Marc Chantreux @ 2006-03-08 14:58 UTC (permalink / raw)
To: zsh-users
Bart Schaefer wrote:
> files=( ${^$(dpkg -L libapache2-mod-perl2)}(e:'[[ -f $REPLY ]]':) )
ahh! good to point on it !
thanks
regards
mc
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-08 14:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-07 15:35 kinda perl grep ? Marc Chantreux
2006-03-07 15:44 ` Peter Stephenson
2006-03-07 15:45 ` Clint Adams
2006-03-07 17:25 ` Bart Schaefer
2006-03-08 14:58 ` Marc Chantreux
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).