Use case for logout of shell

Hello Experts,

I have a use case -

Currently, in my .profile I have added "bash" at the end so while logging in, it will be bashed as well. Which is working fine and no issues.

But while logging out, I have hit exit two times like 1st exit will come out of bash shell and 2nd exit will come out of the server.

So is there a way, that I can log out of the server with one exit from bash?

Why the need at all to run bash from .profile ? What's your login shell? Could you ask your sys admin to change your login shell to bash .

1 Like

If you can't get your admin to change your login shell, you should also just be able to change the last line in your .profile from something like:

bash

to something like:

exec bash

Adding the exec will cause your login shell to be replaced by bash so you won't need to also quit your login shell after you quit bash .

3 Likes

This is fantastic. It worked!

I was on vacation, so couldn`t respond on time.

Thank you so much.

---------- Post updated at 01:16 AM ---------- Previous update was at 01:13 AM ----------

:b:solution found. This can be closed.

some reason i am not seeing the tag option .
@ Admin , if you don`t mind , while you are closing , can you tag this with "solved"

Moderator comments were removed during original forum migration.

why not chsh?