Occasionally I throw together an interactive mode script using the shebang as such:
#!/usr/bin/env bash -i
For some reason of recent, any scripts run in this mode have written their entire contents to my
Contents of test.sh:
#!/usr/bin/env bash -i echo "hello"
13:54:50 ツ :~ >./test.sh hello 13:54:53 ツ :~ >history | tail -4 89969 #!/usr/bin/env bash -i 89970 echo "hello" 89971 ./test.sh 89972 history | tail -4
If I don't have this line in my
shopt -s histappend
Then the problem doesn't occur - but I lose my entire history each time I open a new Terminal tab.
All options in
.bash_profile that relate to history are as follows:
shopt -s histappend set +H export HISTCONTROL=ignoreboth export HISTSIZE=100000 export HISTFILESIZE=100000 export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"