Zsh Mailing List Archive
Messages sorted by:
Re: cml invocation vs script output diff
- X-seq: zsh-users 26345
- From: "jdh" <dhenman@xxxxxxxxx>
- To: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- Cc: <zsh-users@xxxxxxx>
- Subject: Re: cml invocation vs script output diff
- Date: Thu, 07 Jan 2021 15:09:31 -0800
- Archived-at: <https://zsh.org/users/26345>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/20210107150931.7738%40binki>
- In-reply-to: Your message of Thu, 7 Jan 2021 15:51:37 +0000 <20210107155137.GC25249@tarpaulin.shahaf.local2>
- List-id: <zsh-users.zsh.org>
- References: <20210106184613.19412@binki> <20210107155137.GC25249@tarpaulin.shahaf.local2>
Yes, you're right. It was due to .zshrc not being sourced from a script.
Setting the GLOB_DOTS option fixed the problem.
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> jdh wrote on Tue, Jan 05, 2021 at 10:46:13 +0800:
> > zsh vers: zsh 5.8 (x86_64-pc-linux-gnu)
> > Bug: Different results from command line, cml invocation, versus a zsh script file.
> > Test case to demostrate this follows:
> > I don't think that zsh is descending down into . prefixed directories in the script version even with a explict -a given as ls's argument.
> > ---------
> > mkdir .hiddendir
> > touch .hiddendir/tilde-file~
> > ls **/*~ Recursively find all tilde ending filenames starting with the cwd.
> > This above works as it should, but,
> > echo '#! /bin/zsh \n ls **/*~' >lstildefiles
> > chmod 700 lstildefiles
> > ./lsttildefiles
> > Doesn't work and returns:
> > $ ./lstildefiles:2: no matches found: **/*~
> > This shouldn't happen. Why does invoking the same command with the same agrumetns from within a script and the command line differ. The script version is clearly not functioning properly in my opinion. But I can't figure out why. ?
> Probably your zshrc sets the GLOB_DOTS option. zshrc isn't used by scripts,
> only by interactive shells. Diff the output of `setopt` (without arguments)
> between the two cases.
Messages sorted by: