zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: subsitutions and beginning of lines.
Date: Mon, 12 Oct 2015 22:24:57 -0700	[thread overview]
Message-ID: <561C95A9.7020508@eastlink.ca> (raw)
In-Reply-To: <151012220313.ZM16595@torch.brasslantern.com>

On 10/12/2015 10:03 PM, Bart Schaefer wrote:
> On Oct 12,  7:50pm, Ray Andrews wrote:
> }
> } There's a huge section "HISTORY"
> } in the man page
>
> There is?  Where?  There's "HISTORY EXPANSION" but it's all about using
> "!"-references on the command line.  There's a subsection on "History"
> in the section about options.  Where are you looking?
Yup, that's it.
>
> } but it doesn't mention that and I'll probably
> } have to eat my hat when you show me that it does.
>
> This is in "man zshbuiltins" under the "fc" command (to which the
> "history" builtin's doc directs you).
Ooops, so it does.  Still a brief summary of history specific switches 
would
be friendly.  'fc' in it's totality is a bit intimidating.

BTW Bart, the way I was trying to do it was educational so I don't 
regret it,
and I think my question is still a useful exercise: how would we do that
if there was no easy way?  Combining the words results in a 'command not
found' error,  since it seems to want to believe that 'history -10 | 
....' is one
command so I hafta leave the words unmagically joined yet the normal thing
seems to be to strip spaces down to a single one when making an array,
and that's a problem with the methods I was trying.  I don't doubt it's 
easy if you
get the incantation exactly right.  It doesn't help that all this splitting
is invisible.  As you pointed out:
> eval history -n $nnumber $sstring

... is a easy as pie so long as there's no need to massage the output,
but even if you do, I'm betting it's still only a couple of  lines. Of 
course
there's sed, but I'm banking on an internal solution.


>


  reply	other threads:[~2015-10-13  5:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11 19:12 Ray Andrews
2015-10-11 20:09 ` Peter Stephenson
2015-10-11 23:05   ` Ray Andrews
2015-10-12  9:34     ` Peter Stephenson
2015-10-12 15:44       ` Ray Andrews
2015-10-12 17:07         ` Ray Andrews
2015-10-13  2:29           ` Bart Schaefer
2015-10-13  2:50             ` Ray Andrews
2015-10-13  5:03               ` Bart Schaefer
2015-10-13  5:24                 ` Ray Andrews [this message]
2015-10-13 19:58                   ` Bart Schaefer
2015-10-13 21:42                     ` Ray Andrews
2015-10-14  0:23                       ` Bart Schaefer
2015-10-14  5:03                         ` Ray Andrews
2015-10-12  2:26 ` Daniel Shahaf
2015-10-12 15:53   ` Ray Andrews
2015-10-12 16:42     ` Peter Stephenson

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=561C95A9.7020508@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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).