Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Passing sentences to an array
- X-seq: zsh-users 9103
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Passing sentences to an array
- Date: Mon, 18 Jul 2005 16:51:46 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6lcnd1t0qclmgdtjj9v3mlfn9c5fgnsram@xxxxxxx> <1050718151120.ZM5767@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
On Mon, 18 Jul 2005 15:11:20 +0000, wrote:
>On Jul 18, 2:49pm, zzapper wrote:
>}
>} The above instead of a creating an array where each grepped line is an
>} array element (desired behaviour" , creates an array of each word in
>} each of the lines.
>
>This one ought to be in the FAQ.
>
>filessubject=( ${(f)"$(egrep -i 'note [0-9]{3}.*$1' note???.txt)"} )
>
Thanx vmuch Bart,
The above solution however had a quoting problem, where the single quotes were preventing $1 being
evaulated.
I evntually fixed this by creating a global alias
alias -g egrepcmd='egrep -i "note [0-9]{3}.*pink" note???.txt'
filessubject=(${(f)"$(egrepcmd)"} )
print -C 1 $filessubject
But are there any other zsh solutions to the "eternal" quoting problem
--
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author