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

Force globbing inside of parameter substitution



Suppose, I need a list of files sperated by comma. The straightforward way
would be something like

${(j/,/)${:-*}}

Unfortunately, it does not work - it simply results in single `*'.

Using ${(j/,/)$(print *)} does _almost_ wat I'd like ... with two caveats:

1. the file names with spaces are mangled
2. it is potentially less efficient.

Is the use of temporary array the only possibility? (I am mostly interested
in interactive usage, where it should go into one command line).

As a side note: it looks, like GLOB_SUBST does not apply in the above case.
I have globsubst off, but the result of ${:-*} is still globbed. Is it
intentional? I would deem it as a bug.

/andrej



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