Unix Power ToolsUnix Power ToolsSearch this book

1.7. Which Shell Am I Running?

You can usually tell which family your shell belongs to by a character in the prompt it displays. Bourne-type shells, such as bash , usually have $ in the prompt. The C shell uses % (but tcsh users often use >).

If your shell has superuser (Section 1.18) privileges, though, the prompt typically ends with a hash, #.

To check the shell that runs automatically when you log in to Unix, type one of these commands (the second is for systems that use NIS, Sun's Network Information Service, to manage network-wide files):

% grepyourloginname /etc/passwd
% ypmatch yourloginname passwd

You should get back the contents of your entry in the system password file. For example:

shelleyp*:1006:1006:Shelley Powers:/usr/home/shelleyp:/usr/local/bin/bash

The fields are separated by colons, and the default shell is usually specified in the last field.

Note that in Mac OS X, passwords are managed and stored in Netinfo by default. To store the passwords in /etc/passwd, you'll need to configure this using Netinfo.

--TOR and SP



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.