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

Re: protect backslash before space



Nuts, it's easy.  Mark showed me:

alias test='noglob _test'
function _test ()
{
    ls -l -- $~@
}
ls -l -- $@
echo

run:

5 /aWorking/Zsh/Source/Wk 3 % . test junk\ * && test junk\ *
-rw-r--r-- 1 root root 0 Apr  1 10:34 'junk a'
-rw-r--r-- 1 root root 0 Apr  1 10:35 'junk b'
-rw-r--r-- 1 root root 0 Mar 31 18:55 'junk junk'

-rw-r--r-- 1 root root 0 Apr  1 10:34 'junk a'
-rw-r--r-- 1 root root 0 Apr  1 10:35 'junk b'
-rw-r--r-- 1 root root 0 Mar 31 18:55 'junk junk'

... I wonder how much sinful 'eval'ing I'm doing when '$~@' seems to expand the globs just fine.  You don't know what you don't know.





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