Subject: SH_GLOB influence on a script and on an autoload function
From: Sebastian Gniazdowski <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sat, 11 Jun 2016 07:11:38 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Hello
Below is a simple script (save to file rtest1) that works well despite
SH_GLOB should or could stop the pattern from parsing. The same
doesn't work for autoload. If one does:

setopt shglob
FPATH=$FPATH:`pwd`
autoload rtest1
rtest1

then error occurs:

rtest1:8: parse error near `('

Why does this happen? Probably no workaround for this?

Best regards,
Sebastian Gniazdowski

================================

#!/usr/local/bin/zsh-5.2-dev-1 --shglob

emulate -LR zsh
setopt extendedglob

tmp="something txt=1234 something"

if [[ "$tmp" = *txt=(#b)([0-9]##)(|[[:blank:]]*) ]]; then
    echo "Matched, match is: $match[1]"
else
    echo "No match"
fi