Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Passing sentences to an array



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