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

Re: zsh lists being used for spam-gathering?



> print -l blah**blah

Nice. Thanks.

> Why do you want newline-separated filenames anyway?

I run sed on the lines later. I don't want to be messed up with
filenames containing spaces, either. 

Right now i only find this script using ls -d1:


 compctl -k "(- -a -d -F -l -r -t -M -T -s -k -f)" \
 	 -K compmanfull \
 	 -x "C[-1,-s^],s[-s]" -K compmansections \
 	 - "r[-f,;]" -f \
 	 - "r[-k,;]" -k "()" \
 	 - "r[-s,;]" -K compmansection \
 	 -- man
 
 compmanfull() 
    { reply=(${^manpath}/man*/*(N:t:r)) }
 compmansections() 
    { reply=($(ls -d1 ${^manpath}/man*(N:/) | sed 's:^.*/man::')) }
 compmansection()
 {
    local a
    read -Ac a
    echo $a | sed -ne 's/^.* -s\([^ ]*\).*$/\1/p' | read prefix
    reply=(${^manpath}/man$prefix/*(N:t:r))
 }


if someone has better solutions, it would be interesting.

 compmansections() 
    { reply=($(ls -d1 ${^manpath}/man*(N:/) | sed 's:^.*/man::')) }

should be changed for

 compmansections() 
    { reply=($(print -l ${^manpath}/man*(N:/) | sed 's:^.*/man::')) }

for a start...

/Mirar



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