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

Re: Oddity?



09.02.2015, 20:57, "zzapper" <david@xxxxxxxxxxxxxx>:
> Hi
>
>  e(){echo $1} && e (g)

This command is too odd. Just

    echo (g)

does exactly the same. You must read `man zshexpn`, section “Glob Qualifiers”: `g` qualifier stands for “files owned by group ID” and expects group ID as an argument and `G` qualifier is like `(g[$EGID])` (assuming parameter expansion works here (it actually does not)) and takes no parameters.

>
> zsh: missing delimiter for 'g' glob qualifier
>
> e (G) is ok

Do `setopt nullglob` or `setopt nomatch` and you will see that this is *not* OK because `(G)` matches nothing. The only reason this may echo `(G)` is that you have enabled POSIX shell-like behaviour which substitutes glob pattern with itself literally if there are no matches.

>
> --
> zzapper
> https://twitter.com/dailyzshtip
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com



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