Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 105989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:31:34+00:00 2026-05-11T01:31:34+00:00

I know this is supposed to output what kind of shell I’m using, which

  • 0

I know this is supposed to output what kind of shell I’m using, which I think it does, because it outputs ‘bash-3.2’, but it doesn’t quite do that, because it actually changes my prompt to ‘bash-3.2$’. What else is going on? When I do Ctrl+D, I go back to my original prompt. Is this starting the bash shell? I thought by opening a terminal window (I’m in Mac OS X), I was opening a shell program.

I tried to Google, but I couldn’t get any good results for $SHELL. As an aside, how do I get Google to include the ‘$’ in my search?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:31:34+00:00Added an answer on May 11, 2026 at 1:31 am

    Yes, when you open a terminal window you are starting a shell.

    The name of the shell program is stored in the $SHELL variable. Running simply ‘$SHELL‘ at the command line uses the value in that variable, and then interprets it as a command — which runs a new shell. When you exit that shell, you return to the shell where it left off.

    Sort of like when you’re working on something at your desk, and your boss drops some new work on you, so you pause the original work while you do this new thing, and then you can pick up where you left off once you’re done with the new task. 🙂

    This new shell is not a login shell, so it uses a default prompt instead of the prompt specified in your shell login configuration file.

    $SHELL is useful when you need to run a command from within another program. For example, if you’re in a text editor and you want to interpolate the output of a shell command, the editor knows which shell program to run by your $SHELL environment variable.


    Rob Kennedy comments about the $SHLVL variable. This indicates how ‘deep’ you are in shells. For example, when you log in, ‘echo $SHLVL‘ prints 1. If you open a new shell, the same command prints 2. After you quit that subshell and return to your login shell, the command prints 1 again. This is kind of beyond what you were asking, and its uses are more esoteric, but it’s kind of interesting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Know this might be rather basic, but I been trying to figure out how
I know this is fairly subjective, but I'm diving into testing and learning about
I know this question has kind-a started religious wars in past and there might
I know this is largely an opinion, but I'm interested if you have one
I know this sounds like a homework assignment, but it isn't. Lately I've been
I know this can be done and i have seen it done using some
I know this might be a long shot, but here it goes. I have
I know this question has been done but I have a slightly different twist
(I know this is a sort of lazy question, but it's oddly hard to
I know that this is really basic, but I looked everywhere and I cant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.