How to test what shell I am using in a terminal?
For example the following script
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
If it's a local user, the 7th field of /etc/passwd is their shell. Are you looking for the currently preferred shell?