Discovering What Shell You re Using


Discovering What Shell You're Using

When you first log in to your Unix account, you'll be using the default shell on your system. The default shell, its features, and its options depend completely on what your system administrator specifies. Code Listings 3.1 and 3.2 show examples of how default shell prompts differ on two different systems.

Code Listing 3.1. This ISP account uses the /bin/csh shell by default.

xmission> echo $SHELL /bin/csh xmission> finger ejray Login name: ejray    In real life: "RayComm Directory: /home/users/e/ejray    Shell:  /bin/csh On since Jul 23 06:58:48 on pts/16 from  calvin.raycomm.com 1 minute 28 seconds Idle Time No unread mail No Plan. xmission> 

To discover what shell you're using:

  • echo $SHELL

    At your shell prompt, type echo $SHELL (capitalization counts!). This command tells Unix to display (echo) information about shell settings. This information, by the way, is contained in one of the environment variables, so the technical phrasing (which you might hear in Unix circles) is to "echo your shell environment variable."

    The system's response will be the full path to your shellsomething like /bin/csh, /bin/bash, or /bin/ksh.

Code Listing 3.2. On hobbes, a Linux system, the default shell is /bin/bash.

[ejr@hobbes ejr]$ echo $SHELL /bin/bash [ejr@hobbes ejr]$ finger ejr Login: ejr       Name: Eric J. Ray Directory: /home/ejr    Shell: /bin/bash On since Wed Jul 22 07:42 (MDT) on tty1  3 hours 15 minutes idle On since Thu Jul 23 08:17 (MDT) on ttyp0  from calvin No mail. Project: Working on UNIX VQS. Plan: This is my plan-work all day, sleep all  night. [ejr@hobbes ejr]$ 

Tips

  • You can also use finger userid, substituting your login name for userid, to find out more about your shell settings. You can substitute any other userid and see comparable information about the other account holders. See Chapter 7 for more about finger. (Some systems do not support finger, because finger can be a bit of a security hole.)

  • You'll find more information about different shells and their capabilities throughout this chapter.





Unix(c) Visual Quickstart Guide
UNIX, Third Edition
ISBN: 0321442458
EAN: 2147483647
Year: 2006
Pages: 251

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net