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

Re: Bug: Ubuntu apt-get install package-*



On 11/10/2016 05:43 PM, Bob wrote:
> Hello,
> 
> Thank you for your great work on ZSH.
> 
> I'd like to report a bug.
> 
> When I run install commands with `*` for all packages I get a zsh error
> while it works in bash.
> 
> For example I recently tried this: sudo apt-get install numix-wallpaper-*
> 
> Regards,
> Bob
> 

It isn't an bug, the * is a metacharacter used for globbing.
The difference is what the shells do when a glob fails to match a filename.
bash will pass the glob as-is to the command while zsh will stop processing the line.

You can mimic zsh's behavior in bash with: shopt -s failglob
and you can mimic bash's behavior in zsh with: unsetopt nomatch

But by default in zsh if you want to to pass arguments to a command that contain
valid metacharacters to zsh, you have to escape them by quoting.
So the correct way is:

sudo apt-get install numix-wallpaper-\*



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