zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Tip of the day: previous command output
Date: Sat, 21 Aug 2004 10:06:22 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0408210958180.5997@toltec.zanshin.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0408200905300.27591@toltec.zanshin.com>

On Fri, 20 Aug 2004, Bart Schaefer wrote:

> On Fri, 20 Aug 2004, Andy Spiegl wrote:
> 
> > What would be the difference if I dropped alias with the noglob and used 
> > $* instead of $~*?  I guess zsh would expand the globs before calling 
> > the function, right?
> 
> Right.
> 
> >  But the result should be the same or not?
> 
> Should be the same.  Waiting to expand uses a little less memory.

I just thought of another difference ... and remembered the reason that I 
did it the way I did.

Recall:

    keep () {
        kept=()         # Erase old value in case of error on next line
        kept=($~*)
        print -Rc - $kept
    }

Without the noglob, and if you use the NO_MATCH or CSH_NULL_GLOB setopts, 
which I do, then globbing errors occur before the function is called, and 
thus prevent the function from being called.  With the noglob alias, the 
globbing error occurs inside the function, at the second assignment.  The 
distinction is that in the latter case the prevous value of kept is erased 
on a globbing error, whereas in the former case it retains its old value.

I find that having kept set to empty on a glob failure is more useful, but
you may prefer otherwise.


  parent reply	other threads:[~2004-08-21 17:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19  8:58 Jesper Holmberg
2004-08-19 15:20 ` Bart Schaefer
2004-08-19 16:42   ` Andy Spiegl
2004-08-19 17:16     ` Bart Schaefer
2004-08-20  9:30       ` Andy Spiegl
2004-08-20 11:13         ` Vincent Lefevre
2004-08-20 12:12       ` Andy Spiegl
2004-08-20 14:50         ` Vincent Lefevre
2004-08-21  4:25           ` Bart Schaefer
2004-08-21  5:58             ` Bart Schaefer
2004-08-21 17:06             ` Bart Schaefer [this message]
2004-08-22 20:58             ` Vincent Lefevre
2004-08-23  1:10               ` Bart Schaefer
2004-08-23 13:51                 ` Vincent Lefevre
2004-08-22 21:21             ` Vincent Lefevre
2004-08-22 23:03               ` Bart Schaefer
2004-08-23 13:00                 ` Vincent Lefevre
2004-08-23 15:21                   ` Bart Schaefer
2004-08-23 19:14                     ` Vincent Lefevre
2004-08-26 23:16                   ` Andy Spiegl
2004-08-27  0:43                     ` Bart Schaefer
2004-08-27 10:21                       ` Andy Spiegl
2004-08-31 15:03 ` zzapper

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=Pine.LNX.4.61.0408210958180.5997@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).