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

Re: store some parameters/arguments for later use



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