echo $shell not returning anything

Trying to identify the path to the default shell in my environment, using:

echo $shell

However, when I run this, I get a blank response. The system runs for about 5 seconds, then returns nothing in the next line, followed by the command prompt again.

Any ideas what this means, and how do I find the path?

BTW, there is meant to be a path visible if I type that command.

Edit:
Tried echo $SHELL and got the same response from the system.

9

1 Answer

Its possible to read "shell" directly from passwd file:

echo $( getent passwd "${USER}" | cut -d: -f7 )

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like