Score:0

Way to know the current shell in a given terminal

hm flag

I have a shell on a Unix system.

Is there a command that can tell me which shell I am working ? (bash, zsh, etc. )

Rohit Gupta avatar
be flag
I am rushed to post an answer. Have a look [here](https://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#:~:text=How%20to%20check%20which%20shell,is%20running%20at%20the%20movement.)
jm flag
An extensive [solution](https://unix.stackexchange.com/questions/71121/determine-shell-in-script-during-runtime) was given to question several years ago. It was designed for shell scripts but can be put into a function for interactive shells.
Score:2
bh flag

You can use environment variables to get the current shell and the shell for the user that is logged in!

echo $0 - Displays the shell that is currently in use.

echo $SHELL - Displays the shell for the user currently logged in.

NOTE: You can use the printenv command to look at all the env variables

jm flag
`$SHELL` might not be changed if you have started a new shell from your interactive shell.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.