Gente, coloquei alguns comando no arquivo ~/.bash_logout para serem executados antes de fazer logout, só que não está dando efeito. Qualquer comando que eu coloque, ele não é executado. Tem outra configuração que tenho que fazer?
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Repare o que diz na primeira linha: when login shell exits.
Teste em uma sessão de mate-terminal acrescentando uma linha de um comando touch.
Este comando faria criar um arquivo quando no fechamento do terminal.
Não funcionou.
Agora, apertando <Ctrl+Alt+F1> e indo para a tela preta não-gráfica, terminalzão puro mesmo, a coisa mudou.
Fiz login, saí do login. Depois fiz login de novo e o arquivo do touch apareceu lá.
Seria este o arquivo com touch:
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
touch teste.txt
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
E o arquivo touch.txt só é criado no logout, como sugerido na primeira linha do .bash_logout.
----------------------------------------------------------------------------------------------------------------
Nem direita, nem esquerda. Quando se trata de corrupção o Brasil é ambidestro.
(anônimo)
Encryption works. Properly implemented strong crypto systems are one of the few things that you can rely on. Unfortunately, endpoint security is so terrifically weak that NSA can frequently find ways around it. — Edward Snowden
4. Re: Arquivo .bash_logout não é executado.
ghoostuserusa Arch Linux
Post recolhido
Enviado em 10/08/2016 - 21:58h
listeiro_037 escreveu:
Meu .bash_logout:
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Repare o que diz na primeira linha: when login shell exits.
Teste em uma sessão de mate-terminal acrescentando uma linha de um comando touch.
Este comando faria criar um arquivo quando no fechamento do terminal.
Não funcionou.
Agora, apertando <Ctrl+Alt+F1> e indo para a tela preta não-gráfica, terminalzão puro mesmo, a coisa mudou.
Fiz login, saí do login. Depois fiz login de novo e o arquivo do touch apareceu lá.
Seria este o arquivo com touch:
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
touch teste.txt
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
E o arquivo touch.txt só é criado no logout, como sugerido na primeira linha do .bash_logout.
----------------------------------------------------------------------------------------------------------------
Nem direita, nem esquerda. Quando se trata de corrupção o Brasil é ambidestro.
(anônimo)
Encryption works. Properly implemented strong crypto systems are one of the few things that you can rely on. Unfortunately, endpoint security is so terrifically weak that NSA can frequently find ways around it. — Edward Snowden
Eu já tinha feito esse teste com touch, criando um arquivo, mas não tinha feito com TTY (tela preta) e realmente da certo com TTY pura. Mas quando está em modo gráfico, com um ambiente, o arquivo não é criado. Não tem como fazer com ambiente gráfico?