[PLUG] Your favorite $SHELL verbs
Rogan Creswick
creswick at gmail.com
Wed May 7 17:28:48 UTC 2008
On Wed, May 7, 2008 at 9:10 AM, Brent Rieck <bsr at spek.org> wrote:
> Eric Wilhelm wrote:
> > # from Randal L. Schwartz
> > # on Tuesday 06 May 2008:
> >
> >> Unless you have a shell that does history sharing, like my zsh does.
> >
> > eek. I think I'll let you keep that feature!
>
> It's great being able to be able to search back through all of your old
> commands, particularly when it's something from that window you just
> closed..
This is possible in bash (assuming I understand correctly). Below is
the relevant portion of my .bashrc -- all my history-related config is
here, it's not all needed for the shared history command "stuff":
# make a multi-line cmd into one line in history
shopt -s cmdhist
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
# set up the prompt:
promptCommand() {
# save the current history to disk on each command (this enables
on-the-fly history sharing between terminals)
history -a
## Snipped a bunch of stuff to set a PS1 based on system status.
}
export PROMPT_COMMAND=promptCommand
--Rogan
>
> --Brent
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
More information about the PLUG
mailing list