Skip to content

Commit a3ea054

Browse files
authored
history cmd improved
1 parent 22ba9f1 commit a3ea054

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bashrc/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@
2222
Протестировано в `RHEL 8.9`.
2323

2424
```bash
25-
# Last version and documentation: https://github.com/rin-nas/postgresql-patterns-library/tree/master/psqlrc
25+
# last version and documentation: https://github.com/rin-nas/postgresql-patterns-library/tree/master/psqlrc
26+
27+
# the history list is appended to the file named by the value of the HISTFILE variable when the shell exits, rather than overwriting the file
28+
shopt -s histappend
2629

2730
PROMPT_COMMAND=__prompt_command # Function to generate PS1 after CMDs
2831

2932
__prompt_command() {
3033
local EXIT="$?" # This needs to be first
3134

35+
# append the new history lines to the history file
36+
history -a
37+
3238
# https://robotmoon.com/bash-prompt-generator/
3339
local Red='\[\e[1;31m\]'
3440
local Green='\[\e[0;32m\]'

0 commit comments

Comments
 (0)