What is the command to display the shell type? Ans: Code: to get the current shell :
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
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 Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|