Sample Header Ad - 728x90

How can I setup my HPUX profile to use the Linux equivalent of the repeatable commands from history (like !3)?

0 votes
1 answer
139 views
One thing I really like from Linux is to be able to view my history with the "history" command, and then type !# where # is the command from my history that I would like to run. Unfortunately, while HPUX does have a history command, it seems I cannot repeat a command the same way I can in Linux using !#. Is there a way I can implement this in HPUX? So far, the best option I have found would be to create a custom command: https://unix.stackexchange.com/questions/84686/how-to-create-custom-commands-in-unix-linux My approach would be to have a custom command in the format of !n where n is an integer that gets parsed out. The command corresponding to n is parsed from the history and ran. While this is doable, it sure feels like I am reinventing the wheel. Is there a better way to achieve this result? What can I do to repeat commands from my history in HPUX?
Asked by nightmare637 (111 rep)
Jul 8, 2022, 07:42 PM
Last activity: Jul 8, 2022, 08:34 PM