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

Re: problem/bug: array definition from command (backticks) [long]



> With the following line in my ~/.zshrc, I specify the mailfolders that I
> want zsh to watch for new mail:
> 
> mailpath=(`~/bin/printmailfolders-zsh.pl`)

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.


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})"})



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