Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Errors with my youtube-dl function in ~/.zshrc but I am unsure why
On 08/16/2015 02:32 AM, John wrote:
> Why does zsh complain about no matches when I invoke my yt function and how can I correct the code? Thanks!
>
> From ~/.zshrc:
> yt() { [[ -z "$1" ]] || noglob youtube-dl -q "$1" &; }
>
> Output of command:
> % yt https://www.youtube.com/watch?v=OC1JiAUr3ZU :(
> zsh: no matches found: https://www.youtube.com/watch?v=OC1JiAUr3ZU
>
> Please note that I am not subscribed to the ML so please cc me in the reply.
>
You have to call the function with noglob to prevent zsh from thinking ? is a pattern character.
so:
% noglob yt https://www.youtube.com/watch?v=OC1JiAUr3ZU
Messages sorted by:
Reverse Date,
Date,
Thread,
Author