To Display The Shell Type

What is the command to display the shell type?

Ans:

Code:

to get the current shell : 
echo $0

A brief introduction to UNIX shells:

The shell is UNIX's command interpreter. It waits patiently for you to type a command, then figures out what you want to do. It either performs the action itself, or more likely will find and launch whatever you asked for. The shell takes care of finding your commands in the proper directory, maintaining your custom environment, interpreting command-line wildcards, and maintaining a history of your commands for editing and recall. 

One of the UNIX's strengths is that the operating system is not tied to a particular shell. In fact, in UNIX, the shell itself is a program that you execute like any other program. Most UNIX systems know of at least three shells: the Bourne shell (sh), the Korn shell (ksh, the default login shell on tigger), and the C shell (csh). For example, enter: csh 
to run the C-shell. Type: Ctrl-d to exit a shell. Your "login shell" is automatically started for you when you login; using Ctrl-d to exit it will log you out. 

Most shells understand a fairly extensive "scripting" language. It's this property that allows you to collect a bunch of commands in a file, use chmod to make it executable, and execute it by entering its name on the command line. 

One annoying thing about UNIX's having multiple shells is that a shell script written for one shell usually won't work if executed under another shell. Thus, if you usually run ksh, but your friend sends you a script designed to work with csh, you must remember to explicitly run csh before you run the script. An elegant way to get around this is to specify the script's shell in the script itself, by making its first line a special type of comment: 

#!/bin/csh

When you execute the script, your shell (whatever it might be) will "spawn" /bin/csh for it. 
 

Is your command prompt a $? 

The $ is the default prompt for the Korn shell; you're probably using it. Is it a %? Then you're probably using C shell; the % is its default prompt. 
 

Want to change your login shell? 

Enter: chsh 

chsh lists the available shells, tells you what your login shell is, and asks whether you want to change it. 

If you answer yes, it asks you to choose a new shell. For online information on the alternate shells, enter: on tigger: softlist, or on icarus: softlist 

Then select "Utilities, Servers, and Alternate Shells."

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.