I still can't figure out how to run this, but what do I need to run from a (sh) command prompt?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.
Which part of the instructions are you having trouble with?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.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.
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.Maybe sysutils/hstr is what you are looking for. It has freebsd install and configuration instructions on it's github wiki here.
Show us what you tried.
root@X1:~ $ pwd
/root
root@X1:~ $ source redo/redo
sh: source: not found
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
The first line works. The second one does nothing.
root@X1:~ $ pwd
/root
root@X1:~ $ source redo/redo
sh: source: not found
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
Not true. It "sources" the redo script so you can use the functions in it.The second one does nothing.
OK so C-r does something if know about this, but by itself it does nothing.Not true. It "sources" the redo script so you can use the functions in it.
What happens if you press CTRL + r (reverse search) after?
/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.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 ~]#
I guess you didn't notice the commands which showedroot@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.
root@X1:~ $ bash
[root@X1 ~]# source redo/redo
[root@X1 ~]#
redo or hstr though:history_command() {
cmd_full=$(fc -l 1 "$HISTSIZE" | fzy --lines=25)
cmd_only=$(echo "$cmd_full" | awk '{for(i=2; i<=NF; i++) printf "%s ", $i; print ""}')
if [ -n "$cmd_only" ] ; then
set -- "run" "edit"
action="$(printf '%s\n' "$@" | fzy)"
cmd_number=$(echo "$cmd_full" | awk '{print $1}')
case "$action" in
run) eval "$cmd_only" ;;
edit)...
Hello balanga, I hope you finally found a good setup to browse your history.I guess you didn't notice the commands which showed
sh:root@X1:~ $ bash [root@X1 ~]# source redo/redo [root@X1 ~]#
hstr was a program that I liked the look of but it didn't work with sh's history file.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
set -o vi). Now, I don't use Bash myself but its manualpage does mention this option (I prefer shells/pdksh myself). ls /usr/local because I'm too lazy ( pdksh is something I have never used, but I imagine it is used by aficionadosI 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).
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 cshpdksh is something I have never used, but I imagine it is used by aficionados.