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

Re: globbing working on CLI but not in file



 ❦ 11 novembre 2018 22:53 +0100, Eric Smith <es@xxxxxxxxxxxx>:

> This glob works when executed on the CLI
>
> $  ls [^~](#i)*xls*(.om[1])
> something_with_xls_in_it.xls
>
> But not in a file
>
>  $ /usr/bin/zsh --no-rcs -x bin/lastmatch
> +/etc/zsh/zshenv:15> [[ -z /Users/eric/bin: ... other path here ////bin:/usr/bin ]]
> bin/lastmatch:2: no matches found: [^~](#i)*xls*(.om[1])
>
>  $ zsh --version
> zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
>
> Thanks to anyone who can help me to run this in a script.

You need to enable extendedglob option:

 setopt extendedglob
-- 
Suspicion always haunts the guilty mind.
		-- Wm. Shakespeare



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