[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature: Easily remove current command from history
From: |
Greg Wooledge |
Subject: |
Re: Feature: Easily remove current command from history |
Date: |
Tue, 5 Jan 2016 08:08:32 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Jan 04, 2016 at 04:35:17PM -0600, Dennis Williamson wrote:
> > Just bind your own keystroke to a function which uses history -d:
> >
> > histdel() {
> > local last_command histline
> >
> > last_command=$(history 1)
etc.
Hmm. Why isn't this easier...?
imadev:~$ help history
...
Options:
...
-d offset delete the history entry at offset OFFSET.
What's an OFFSET?
imadev:~$ zap me
bash: zap: command not found
imadev:~$ history -d -1
bash: history: -1: history position out of range
imadev:~$ history -d end
bash: history: end: history position out of range
Allowing a negative offset to refer to the last (or last minus however
many) entry would probably satisfy the original request. Semantically,
there's precedent with negative array indices and negative starting
positions in ${parameter:offset:length} notation.
- Re: Feature: Easily remove current command from history, (continued)
- Re: Feature: Easily remove current command from history, Chet Ramey, 2016/01/04
- Re: Feature: Easily remove current command from history, Victor Porton, 2016/01/04
- Re: Feature: Easily remove current command from history, Chet Ramey, 2016/01/04
- Re: Feature: Easily remove current command from history, Victor Porton, 2016/01/04
- Re: Feature: Easily remove current command from history, Piotr Grzybowski, 2016/01/04
- Re: Feature: Easily remove current command from history, Greg Wooledge, 2016/01/04
- Re: Feature: Easily remove current command from history, Victor Porton, 2016/01/04
- Re: Feature: Easily remove current command from history, Eduardo A . Bustamante López, 2016/01/04
- Re: Feature: Easily remove current command from history, Dennis Williamson, 2016/01/04
- Re: Feature: Easily remove current command from history, Dennis Williamson, 2016/01/04
- Re: Feature: Easily remove current command from history,
Greg Wooledge <=
- Re: Feature: Easily remove current command from history, Chet Ramey, 2016/01/07
- Re: Feature: Easily remove current command from history, Piotr Grzybowski, 2016/01/08
- Re: Feature: Easily remove current command from history, Chet Ramey, 2016/01/11
- Re: Feature: Easily remove current command from history, Dennis Williamson, 2016/01/05
- Re: Feature: Easily remove current command from history, Andreas Schwab, 2016/01/04