|  | 
| 22 | 22 | Протестировано в `RHEL 8.9`. | 
| 23 | 23 | 
 | 
| 24 | 24 | ```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 | 
| 26 | 29 | 
 | 
| 27 | 30 | PROMPT_COMMAND=__prompt_command # Function to generate PS1 after CMDs | 
| 28 | 31 | 
 | 
| 29 | 32 | __prompt_command() { | 
| 30 | 33 |  local EXIT="$?" # This needs to be first | 
| 31 | 34 | 
 | 
|  | 35 | + # append the new history lines to the history file | 
|  | 36 | + history -a | 
|  | 37 | + | 
| 32 | 38 |  # https://robotmoon.com/bash-prompt-generator/ | 
| 33 | 39 |  local Red='\[\e[1;31m\]' | 
| 34 | 40 |  local Green='\[\e[0;32m\]' | 
|  | 
0 commit comments