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

Re: problem/bug: array definition from command (backticks) - solved



On Tue, Jun 26, 2001 at 11:12:14PM -0400, Clint Adams wrote:

> If you read the docs on command substitution, you'll see that
> 
> 	If  the  substitution  is  not
> 	enclosed in double quotes, the output is
> 	broken into words using the IFS parameter.

Oops, I must have overseen this. :)  However, thanks to the hint with
the double quotes, I could make my expression work:

mailpath=("$($HOME/bin/printmailfolders-zsh.pl)")

or

mailpath=("`$HOME/bin/printmailfolders-zsh.pl`")

does The Right Thing (TM).

> I think that the following accomplishes what you want, except for checking
> if the file is ASCII.
> 
> mailpath=(${(f)"$(for i in $HOME/{Mail,savenews}/[^.]*(.rNL+0) ; print $i\?New mail in ${i:t})"})

Unfortunately, this doesn't work for me.  But as the other version's up
and running and more extensible (could parse every file if it's really a
mailbox, for example), this isn't a problem.

Thanks again for the help.

Jörg



Messages sorted by: Reverse Date, Date, Thread, Author