Force the terminal emulator to read .bash_logout (or .logout, etc.)


Pom

Searching failed me.

I noticed that some terminal emulators (gnome-terminal, terminator, maybe others) don't execute my logout file. Works fine in a virtual terminal, but not through an emulator.

I looked at the man page (for the emulator), but there doesn't seem to be an option to force a logout file.

is it possible?

Julio Noble

According to the bash manual:

When the login shell exits, bash reads and executes commands from the ~/.bash_logout and /etc/bash.bash_logout files (if they exist).

So execute when bash_logoutthe login shell exits . It could be that the emulator doesn't have a login shell open, you can make some configuration changes on the client to make sure it loads the login shell every time.

Alternatively, you can use -lor open a new shell --loginwhich will load a login shell for you.

Related


bash_logout and history

User unknown I like to save all history in bash to a kind of log file, and created an extra directory ~/lib/hists/ for this purpose. It's easy to write a log file like this in the shell: history -w /home/stefan/lib/hists/bash-hist-$(date +%F_%T_%N) Now if I c

bash_logout and history

User unknown I like to save all history in bash to a kind of log file, and created an extra directory ~/lib/hists/ for this purpose. It's easy to write a log file like this in the shell: history -w /home/stefan/lib/hists/bash-hist-$(date +%F_%T_%N) Now, if I

bash_logout and history

User unknown I like to save all history in bash to a kind of log file, and created an extra directory ~/lib/hists/ for this purpose. It's easy to write a log file like this in the shell: history -w /home/stefan/lib/hists/bash-hist-$(date +%F_%T_%N) Now, if I

bash_logout and history

User unknown I like to save all history in bash to a kind of log file, and created an extra directory ~/lib/hists/ for this purpose. It's easy to write a log file like this in the shell: history -w /home/stefan/lib/hists/bash-hist-$(date +%F_%T_%N) Now, if I

"rxvt" terminal emulator resets settings after logout

Abrit Pal Singh Whenever I log out, rxvt resets to its ugly out-of-the-box look. Then I had to run the following command to restore my settings. xrdb ~/.Xresourses Do I need to do this every time I log out? Please help this is what it looks like after login.

What is the purpose of .bash_logout?

herpes free engineer The question " What is the purpose of .bashrc and how does it work? " seeks the purpose and purpose of .bashrc.bashrc . Another file with a similar name is .bash_logout. Should the file exist in the first place? If so, what is the purpose

What is the purpose of .bash_logout?

herpes free engineer The question " What is the purpose of .bashrc and how does it work? " seeks the purpose and purpose of .bashrc.bashrc . Another file with a similar name is .bash_logout. Should the file exist in the first place? If so, what is the purpose

Bash equivalent of FISH shell to .bash_logout

Diva Usually, I write exit scripts for the shell bashin .bash_logout. I have recently started using the fishshell. The .bashrcequivalent of fishis located, ~/.config/fish/config.fishbut where to find the equivalent .bash_logout? Chepner Instead of defining a s

.bash_logout not running on putty exit

Suraf I have some script .bash_logoutfiles. The script is running when the user logs out with Ctrl+ dor with the exitcommand . If someone closes the putty application directly instead of logging out of the system, the .bash_logoutprogram is not running. .bash_

How to call .bash_logout on CentOS

Ian Hacker I'm trying to call my own .bash_logout on CentOS when the user logs out. However, .bash_logout is not called/executed (it just logs out) even though the "exit" command is sent. On CentOS, when I type "exit" and click "return", the system says "exit"

.bash_logout not running on putty exit

Suraf I have some script .bash_logoutfiles. The script is running when the user logs out with Ctrl+ dor with the exitcommand . If someone closes the putty application directly instead of logging out of the system, the .bash_logoutprogram is not running. .bash_

Force command to run on logout

Darpan Ganatra I want to run a command that says touch ~/test.txt every time I log out of my computer. Is that possible and if so how can I go about doing it? I've looked at the other replies but they are a bit vague. Specifically, it was mentioned that if I w

Force logout in VBS script

Orion I've been working on a script that runs whenever a user logs in. It checks for a .csv file containing computer names and usernames. If the computer the user is logging into is in the .csv file and the user is not "assigned", it will log them out. This wo

Symfony, force logout of controller

You are I'm using Symfony 3.4 and I want to log out the user when the controller action ends. this is action public function changeUserEmail() { /* change the user email */ /* perform the logout */ /* choose the route to redirect to */ retu

What is the shortcut to force logout?

Chris King I'm using the alpha 2 version of 11.10, and the keyboard options there don't have an option to force logout. Can you tell me the keyboard shortcut so I can add it myself? Chris King It seems that the latest update adds an "Options" menu on Keyboard

Force user logout with Devise

tomorrow I have a controller filter that should log a user out if their account has expired, but I don't know an easy way. I tried: if user_signed_in? && current_user.status == 'expired' redirect_to destroy_user_session_path end But the above doesn't work b

WordPress: Force logout

Kausha Mehta When I use the "Profile Builder" plugin to change the password from the frontend profile change function. I manually add the logout functionality like this: <a href="<?php echo wp_logout_url(home_url()); ?>" title="Logout">Logout</a> It then asks

Force command to run on logout

Darpan Ganatra I want to run a command that says touch ~/test.txt every time I log out of my computer. Is that possible and if so how can I go about doing it? I've looked at the other replies but they are a bit vague. Specifically, it was mentioned that if I w

Force logout in VBS script

Orion I've been working on a script that runs whenever a user logs in. It checks for a .csv file containing computer names and usernames. If the computer the user is logging into is in the .csv file and the user is not "assigned", it will log them out. This wo

Symfony, force logout of controller

You are I'm using Symfony 3.4 and I want to log out the user when the controller action ends. this is action public function changeUserEmail() { /* change the user email */ /* perform the logout */ /* choose the route to redirect to */ retu

Force command to run on logout

Darpan Ganatra I want to run a command that says touch ~/test.txt every time I log out of my computer. Is that possible and if so how can I go about doing it? I've looked at the other replies but they are a bit vague. Specifically, it was mentioned that if I w

WordPress: Force logout

Kausha Mehta When I use the "Profile Builder" plugin to change the password from the frontend profile change function. I manually add the logout functionality like this: <a href="<?php echo wp_logout_url(home_url()); ?>" title="Logout">Logout</a> It then asks

Why don't the commands in .bash_logout work after rebooting?

shaved Operating system: debian9. Create a log file. touch $HOME/logout.log Add the command in .bash_logout. vim .bash_logout echo $(date) >> $HOME/logout.log Now log in with the account name testand create /home/test/logout.log. I want to write date info

Explain why .bash_logout can't run the command?

Drying dance So I've been wondering how to run these two lines of code every time an open instance of Terminal is closed: history -c cat /dev/null > ~/.bash_history I'm export HISTFILE=5on startup, but still want to rinse it off when I'm done. I've tried look

Why don't the commands in .bash_logout work after rebooting?

shaved Operating system: debian9. Create a log file. touch $HOME/logout.log Add the command in .bash_logout. vim .bash_logout echo $(date) >> $HOME/logout.log Now log in with the account name testand create /home/test/logout.log. I want to write date info