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

Re: refering to 2nd from last history parameter?



Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote in 
news:CAECNH1RyC2Q-5y3Ynk-F+cJvtRvFPWdvcpDOqXmrJB=uSJCbTQ@xxxxxxxxxxxxxx:

> On Thu, 22 Jan 2015 12:18:19 +0000
> zzapper <david@xxxxxxxxxxxxxx> wrote:
>> I don't think it's possible
>>
>> ls !$    last parameter of previous command
>>
>> echo a b c d e f g h
>>
>> I don't think I can grab 'g' without counting left to right
> 
> This isn't actually a question :-).  What are you trying to do?  Are 
you
> at the shell command line trying to extract something and don't care 

Peter
I realised I hadn't been clear.

echo a b c d e f g h

echo !:7
g

but it would be cuter if I could specify

echo !:$-1   ### doesnt work

but is there anyway to do this?
(I may have asked this before)





---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com




Messages sorted by: Reverse Date, Date, Thread, Author