I am writing a zsh script, and the following line in my script fails:
rm -f ${ZT_BASE_PATH}/*_${(q)ZT_SESSION_ID}
with error
function:lineno: no matches found: /home/user/.zsh/.tmux_base/*_\$0
However, when I substitute the offending line with
rm -f /home/user/.zsh/.tmux_base/*_\$0
it succeeds, deleting the proper files. Is there a reason the globbing does not work in the first case? Here is the zsh version and setopt output:
$ zsh --version
zsh 5.0.2 (i686-pc-linux-gnu)
$ setopt
alwaystoend
autocd
autocontinue
autonamedirs
autopushd
chaselinks
completealiases
completeinword
correct
extendedglob
extendedhistory
noflowcontrol
noglobalrcs
globcomplete
globdots
histignorealldups
histignoredups
histreduceblanks
histsavenodups
histverify
nohup
incappendhistory
interactive
interactivecomments
listpacked
listrowsfirst
login
longlistjobs
markdirs
monitor
promptsubst
pushdignoredups
pushdminus
pushdsilent
pushdtohome
rcexpandparam
rematchpcre
shinstdin
transientrprompt
zle