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

Re: Alias help



HI Eric, 

Thanks for answering a newbie question.  As zzapper suggested, I might try keeping this command as a function.  

Aki 

> On Apr 26, 2021, at 7:15 PM, Eric Cook <llua@xxxxxxx> wrote:
> 
> On 4/26/21 6:55 PM, Hoji, Aki wrote:
>> alias pu ="pip3 list -o | sed "1,2 d" |cut -d ' ' -f1 |  xargs -n1 pip3 install -U”
> 
> As a shell function:
> pu() {                                                                                                                 ~
>  pip3 list -o   |
>  sed "1,2 d"    |
>  cut -d ' ' -f1 |
>  xargs -n1 pip3 install -U
> }
> 
> While not to the degree of say python, whitespace matters often in shell;
> You have an extra space after the name of the alias pu, so the =word triggered a different
> feature of zsh that expands the path to a command. in this case "pip3 list -o | sed 1,2"
> once you remove the space you still have the problem of not quoting correctly.
> 
> alias pu='pip3 list -o | sed "1,2 d" |cut -d '\'' '\'' -f1 |  xargs -n1 pip3 install -U'
> 
> Is how to quote that command properly, which is less readable than a function is in my opinion.
> 





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