mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 12:01:32 +00:00
Force bash history to be flushed before executing commands
This commit is contained in:
parent
8e8963b0f8
commit
117e7ffc18
11
Dockerfile
11
Dockerfile
@ -39,14 +39,9 @@ ENV PYTHONPATH="/usr/local/lib/" \
|
|||||||
TFW_HISTFILE="/home/${AVATAO_USER}/.bash_history" \
|
TFW_HISTFILE="/home/${AVATAO_USER}/.bash_history" \
|
||||||
PROMPT_COMMAND="history -a"
|
PROMPT_COMMAND="history -a"
|
||||||
|
|
||||||
RUN echo "shopt -s cmdhist\n" \
|
COPY bashrc /tmp
|
||||||
"shopt -s histappend\n" \
|
RUN echo "export HISTFILE=${TFW_HISTFILE}\n" >> /tmp/bashrc &&\
|
||||||
"unset HISTCONTROL\n" \
|
cat /tmp/bashrc >> /home/${AVATAO_USER}/.bashrc
|
||||||
"export HISTFILE=$TFW_HISTFILE\n" \
|
|
||||||
"export HISTFILESIZE=1000\n" \
|
|
||||||
"export HISTSIZE=1000\n" \
|
|
||||||
'PROMPT_COMMAND="history -a"\n' \
|
|
||||||
>> /home/${AVATAO_USER}/.bashrc
|
|
||||||
|
|
||||||
COPY supervisor/supervisord.conf ${TFW_SUPERVISORD_CONF}
|
COPY supervisor/supervisord.conf ${TFW_SUPERVISORD_CONF}
|
||||||
COPY nginx/nginx.conf ${TFW_NGINX_CONF}
|
COPY nginx/nginx.conf ${TFW_NGINX_CONF}
|
||||||
|
20
bashrc
Normal file
20
bashrc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
_postcmd()
|
||||||
|
{
|
||||||
|
AT_PROMPT=1
|
||||||
|
history -a
|
||||||
|
}
|
||||||
|
PROMPT_COMMAND="_postcmd"
|
||||||
|
|
||||||
|
_precmd()
|
||||||
|
{
|
||||||
|
[ -z "$AT_PROMPT" ] && return
|
||||||
|
unset AT_PROMPT
|
||||||
|
history -a
|
||||||
|
}
|
||||||
|
trap _precmd DEBUG
|
||||||
|
|
||||||
|
shopt -s cmdhist
|
||||||
|
shopt -s histappend
|
||||||
|
unset HISTCONTROL
|
||||||
|
export HISTFILESIZE=1000
|
||||||
|
export HISTSIZE=1000
|
Loading…
Reference in New Issue
Block a user