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

Re: Some problems with recursive globbing



Hmm, I still can't get this to work.

I tried this:
myfiles() {
    emulate -L zsh
    setopt LOCAL_OPTIONS EXTENDED_GLOB

    local dir="${1:a}/"

    local filepattern="${dir}**/*"

    print -c ${~filepattern}
}

% cd /private/tmp/test\(1\)
% myfiles src
myfiles:8: no matches found: /private/tmp/test(1)/src/**/*


And then this:
myfiles() {
    emulate -L zsh
    setopt LOCAL_OPTIONS EXTENDED_GLOB

    local dir="${(q)1:a}/"

    local filepattern="${dir}**/*"

    print -c ${~filepattern}
}

% cd /private/tmp/test\ 1
% myfiles src
myfiles:8: no matches found: /private/tmp/test\ 1/src/**/*

So it still fails on either parentheses or spaces, depending on if I quote
the parameter.


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