paulirish / dotfiles

paul's fish, bash, git, etc config files. good stuff.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

histappend not being set, since shopt is a shell builtin

bdashrad opened this issue · comments

histappend is not being set correctly in your current dotfiles, since shopt is a shell builtin.

This happens because of this line in .bash_profile: https://github.com/paulirish/dotfiles/blob/master/.bash_profile#L48

which shopt &> /dev/null && shopt -s histappend  # append to history, don't overwrite it

Example:

$ which shopt
~/dotfiles on master*
$ type shopt
shopt is a shell builtin
~/dotfiles on master*
$ which shopt &> /dev/null && echo "working"
$ echo $?
1

You could remove the test or use:

type shopt &> /dev/null && shopt -s histappend  # append to history, don't overwrite it

Example:

~/dotfiles on master*
$ type shopt &> /dev/null && echo "working"
working
$ type fakecommand &> /dev/null && echo "working"
~/dotfiles on master*
$ echo $?
1

thanks man! really appreciate this PR

shopt now sorted out properly.

I caught it on mine and realized i stole it from you.