I don't actually want to do this; the Law of Unintended Consequences looms large over this idea. I'm just curious if the capability even exists. Similar functionality might be handy for some scripts as a break out step.Suppose I want to write this into a ${HOME}/.logout file:#! /bin/bashcd /path/to/git/working/projectif [ $( git status | wc -l ) -gt 5 ]then  echo Check in your work before you leave.  <STOP THE LOG OUT PROCESS AND RETURN TO THE SHELL PROMPT>fiHow would I do that last bit? Would a break do it?
Cancelling a logout and returning to a shell
shell script;shell
First configure a trap in the session for the exit behavior: trap ~/.logout EXITIf you want you can add this trap behavior to the bashrc, and then .logout script will be executed every time the users try to exit the shell. And then you can write the .logout script: #!/bin/bashcd /path/to/git/working/projectif [ $( git status | wc -l ) -gt 5 ]then  echo Check in your work before you leave.  bash fiThen when you try to exit the session the script .logout will be executed, and the bash will show up to check if the user does the right thing. If the users does whatever is right with git, the session will end normally. 