Solved Scrollable history?

source the redo script mentioned above in zsh or bash. type the start few letters of a previous command and hit ctrl-r. you’ll see zsh/bash itself show a few command lines. you can scroll down/up to select one and execute it. more keys are bound to other actions. read the redo script.
 
source the redo script mentioned above in zsh or bash. type the start few letters of a previous command and hit ctrl-r. you’ll see zsh/bash itself show a few command lines. you can scroll down/up to select one and execute it. more keys are bound to other actions. read the redo script.
I still can't figure out how to run this, but what do I need to run from a (sh) command prompt?

Do I need to run bash first?

Can you give me a command to run to get this started? I've tried all sorts, but I'm not familiar with bash even though I have it installed.
 
Can you give me a command to run to get this started? I've tried all sorts, but I'm not familiar with bash even though I have it installed.
Which part of the instructions are you having trouble with?

2025-11-19-231834_1920x1080_scrot.png
 
I still can't figure out how to run this, but what do I need to run from a (sh) command prompt?

Do I need to run bash first?

Can you give me a command to run to get this started? I've tried all sorts, but I'm not familiar with bash even though I have it installed.
Show us what you tried.
 
Maybe sysutils/hstr is what you are looking for. It has freebsd install and configuration instructions on it's github wiki here.
Many thanks, that's exactly the sort of thing I was looking for, and works straight out of the box unlike redo by running hstr without the need to specify the shell and do other things which never figured out.
 
The first line works. The second one does nothing.

sh:
root@X1:~ $ pwd
/root
root@X1:~ $ source redo/redo
sh: source: not found
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
/bin/sh doesn't know about "source" (for sourcing a file you use "." in /bin/sh) but the instructions clearly say this is for zsh or bash. The second source merges the result of commands in redo in the current bash. After this what is described in README.md should work but it seems you are not actually reading the README.md carefully enough.
 
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
/bin/sh doesn't know about "source" (for sourcing a file you use "." in /bin/sh) but the instructions clearly say this is for zsh or bash. The second source merges the result of commands in redo in the current bash. After this what is described in README.md should work but it seems you are not actually reading the README.md carefully enough.
I guess you didn't notice the commands which showed

sh:
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
 
May be this can be a solution too, probably not convenient as redo or hstr though:
 
My .bash_history is the most precious data I have. I'm always careful to backup this one. And never forget to increase HISTSIZE.

"Those who forget history are condemned to repeat it".
 
I guess you didn't notice the commands which showed

sh:
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
Hello balanga, I hope you finally found a good setup to browse your history.
It seems you were not very experimented using unix shell, and yes, can be tricky if not knowing a minimum of shell conventions.
sh is not bash, and is not zsh (using sh is setting posix limited shell, even if just linked to bash), so yes, must use posix conventions, (as using dot to source shell instead of source command, but still as running posix, have limitations).
I think, for most of unix user, redo is quite simple to understand, just source it and use standard ctrl-r (standard bash history search), esc-/ (vi mode standard history search) or even shift-tab to access your command history.
You can even begin to type your command and use ctrl-r, esc-/, shift-tab to have history list filtered with your typing.
Hope you enjoy your unix trip
:)
sincerely, joknarf
 
Hello balanga, I hope you finally found a good setup to browse your history.
It seems you were not very experimented using unix shell, and yes, can be tricky if not knowing a minimum of shell conventions.
sh is not bash, and is not zsh (using sh is setting posix limited shell, even if just linked to bash), so yes, must use posix conventions, (as using dot to source shell instead of source command, but still as running posix, have limitations).
I think, for most of unix user, redo is quite simple to understand, just source it and use standard ctrl-r (standard bash history search), esc-/ (vi mode standard history search) or even shift-tab to access your command history.
You can even begin to type your command and use ctrl-r, esc-/, shift-tab to have history list filtered with your typing.
Hope you enjoy your unix trip
:)
sincerely, joknarf
hstr was a program that I liked the look of but it didn't work with sh's history file.

I didn't want to use bash, but now I have adopted zsh and have h as an alias for hstr an it works the way I want.

And yes I am enjoying my unix trip, but unfortunately I find that I am getting further behind with every day that passes as I learn that there are more and more things that I know so little about.
 
I know I'm very late to the party, but I have another take on this... I'm sure many of you won't like it but many shells also support the so called vi mode ( set -o vi). Now, I don't use Bash myself but its manualpage does mention this option (I prefer shells/pdksh myself).

Anyway... with this mode enabled it's easier (IMO) to edit your current commandline (by pressing escape to enter 'vi mode') but you can also immediately scroll through your backlog. Not just that: you can also actively search for previous commands as well.

For example... say I want to retrieve ls /usr/local because I'm too lazy ( :oops: ). I simply press escape, followed by / after which I simply type 'loc' followed by enter and I got my command back.

Probably not useful for someone who isn't familiar with the vi keyboard shortcuts, but then again... that in itself could be a good excuse to play more Nethack ;)
 
I know I'm very late to the party, but I have another take on this... I'm sure many of you won't like it but many shells also support the so called vi mode ( set -o vi). Now, I don't use Bash myself but its manualpage does mention this option (I prefer shells/pdksh myself).
pdksh is something I have never used, but I imagine it is used by aficionados ;).
 
pdksh is something I have never used, but I imagine it is used by aficionados ;).
Well, the main reason why I keep on using it is because it was the de-facto standard within Sun Solaris. So when I stopped using Solaris and moved on I wanted to hold on to that familiar environment. Or maybe I'm just not open to change... I also refuse to change my root shell and continue to use csh ;)
 
Back
Top