helpThe GNU Bourne-Again SHell - Support: sr #110466, Reverse counting of history...

 
 

sr #110466: Reverse counting of history commands

Submitter:  None
Submitted:  Fri 26 Mar 2021 09:29:18 AM UTC
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  Wont Do
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Tue 06 Apr 2021 06:20:25 PM UTC, comment #2: 

comment #1:

> Thanks for the proposal. I don't think it adds enough general value to add at this time.
>


Thanks Chet, I understand.

Sebastian Engel <blubase>
Tue 06 Apr 2021 04:39:47 PM UTC, comment #1: 

Thanks for the proposal. I don't think it adds enough general value to add at this time.

Chet Ramey <chet>
Project Administrator
Fri 26 Mar 2021 09:29:18 AM UTC, original submission:  

== Background==
Running history will output something like this:
$ history 5
 1004  man whatis
 1005  man builtin
 1006  ls /home
 1007  man apropos
 1008  history 5

With the command !1006 we can repeat the respective command.
Moreover, there is a some what equivalent repeat command: !-3

Idea

I think, it might be somewhat useful to have a switch to show the reversed counting of the history. For example like this:

$ history -5
   -5  man whatis
   -4  man builtin
   -3  ls /home
   -2  man apropos
   -1  history -5

This way, it becomes explicit what the reversed repeat, such as !-3 would mean.

Discussion

I understand this idea might be more eye candy than it is useful since the reversed repeat changes every time.
That's why I would like to ask the maintainers whether you see this as an acceptable change. If that is the case, i would work on a patch.

-----

After briefly glancing at the source code of the history command, i can see that the display function would require an additional flow path (a while loop for the reversed counting). The more involved part would be inserting an additional flag and argument parsing.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blubase (Posted a comment)
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-06 chet StatusNone Wont Do

    Back to the top


    Powered by Savane 3.9