Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change how history works in Bash

  • Loading branch information...
commit f60957b93f8e187a4061ff2fbb259fd9352fb393 1 parent 828b5da
@icco authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  link/bash_PS1
  2. +6 −0 link/bashrc
View
2  link/bash_PS1
@@ -61,7 +61,7 @@ bash_prompt() {
PS1="${RST}\n[ ${EMR}\$(date +\"%a %b %d %k:%M:%S\")${RST} ] $GITBRANCH \n${RST}[ ${UC}\u${RST}@${UC}\h ${EMB}\${NEW_PWD}${RST} ]${UC}\\$ ${RST}"
}
-PROMPT_COMMAND=bash_prompt_command
+export PROMPT_COMMAND="$PROMPT_COMMAND; bash_prompt_command"
bash_prompt
unset bash_prompt
View
6 link/bashrc
@@ -14,6 +14,12 @@ export DEBEMAIL="nat@natwelch.com"
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
+# Append history instead of last closed terminal wins
+shopt -s histappend
+
+# Append every command to history
+export PROMPT_COMMAND="history -n; history -a"
+
# give me the correct compiler
export CC=/usr/bin/gcc
Please sign in to comment.
Something went wrong with that request. Please try again.