Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: store some parameters/arguments for later use
- X-seq: zsh-users 10904
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: store some parameters/arguments for later use
- Date: Wed, 25 Oct 2006 09:19:41 -0400
- In-reply-to: <Xns9867764CABBACzzappergmailcom@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns9866B9D0D4D89zzappergmailcom@xxxxxxxxxxx> <20061025003630.GA1077@xxxxxxxxxxxxxxxxxxx> <Xns9867764CABBACzzappergmailcom@xxxxxxxxxxx>
zzapper sent me the following 0.5K:
> >> > ls x1 x2 x3
> >> save_parameters
> >> ...
> >> ...
> >> ...
> >> vi recall_parameters
>
> What I've come up with is
>
> spar () {
> P="$(history -n -1|sed 's/^[^ ]* //')"
> }
>
> and then anytime later I can say
>
> vi $P
If you want to save a process, you can try:
$ echo a b c
$ P="!:*"
$ echo $P
There's probably an alias you could come up with to ease the assignment.
!:* grabs all but the first word from the previous command.
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author