zsh-users
 help / color / mirror / code / Atom feed
From: Akihiko Hohji <akhst7@me.com>
To: zsh-users@zsh.org
Cc: Eric Cook <llua@gmx.com>, zsh@rayninfo.co.uk
Subject: Re: Alias help
Date: Tue, 27 Apr 2021 09:06:37 -0400	[thread overview]
Message-ID: <872A3A9E-541A-4B72-BB5A-F2EE7ADD0FEE@me.com> (raw)
In-Reply-To: <a08205a9-64fc-56a2-c06c-5a1914f1c8ff@gmx.com>

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@gmx.com> 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.
> 



      parent reply	other threads:[~2021-04-27 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 22:55 Hoji, Aki
2021-04-26 23:15 ` Eric Cook
2021-04-27  7:10   ` zzapper
2021-04-27 20:41     ` Bart Schaefer
2021-04-29 13:30     ` Daniel Shahaf
2021-04-29 13:55       ` zzapper
2021-04-29 14:13         ` Daniel Shahaf
2021-04-27 13:06   ` Akihiko Hohji [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=872A3A9E-541A-4B72-BB5A-F2EE7ADD0FEE@me.com \
    --to=akhst7@me.com \
    --cc=llua@gmx.com \
    --cc=zsh-users@zsh.org \
    --cc=zsh@rayninfo.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).