2

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
  • 2
    It is echo $SHELL
    – Terrance
    Apr 22, 2019 at 15:59
  • Thanks for the quick reply. Tried it, but still got a blank response. Will edit above as well
    – Clauric
    Apr 22, 2019 at 16:00
  • What kind of system is it? What does grep $USER /etc/passwd produce?
    – vidarlo
    Apr 22, 2019 at 16:02
  • @vidarlo Clauric:x:1001:1001:,,,:/home/Clauric:/bin/bash
    – Clauric
    Apr 22, 2019 at 16:03
  • 1
    Try reboot and then echo $SHELL
    – Vijay
    Apr 22, 2019 at 16:29

1 Answer 1

1

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .