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: 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?
ksh(based on Korn 88) or evenksh93don't offer the advanced history features thatbashdoes.