100 likes | 238 Views
This guide explores various UNIX shells, including Bourne, C, Bash, Zsh, Korn, and Tcsh. We discuss the fundamental role of a shell as both a command interpreter and a programming language, essential for writing shell scripts. The document details how commands executed in a shell create processes, enabling multitasking. It explains typical UNIX shell usage patterns and provides instructions for temporarily changing your shell or setting a default shell using the `chsh` command. Gain insights into optimizing your UNIX experience through shell selection and customization.
E N D
Advanced UNIX 240-491 Special Topics in Comp. Eng. 1Semester 2, 2000-2001 • Objectives • to discuss the various UNIX shells 5. Which Shell?
Overview 1. What is a Shell? 2. There are many UNIX Shells 3. The ‘usual’ Mix 4. Changing your Shell
1. What is a Shell? • A command interpreter and • a programming language. • The programing language part is used to write shell scripts.
Processes • When your shell executes a command (or script), it forks (creates) a process. • A process is a separate executing entity, with its own Process ID (PID) and memory. • UNIX allows many processes to execute at once • multi-tasking
2. There are many UNIX Shells Just a few of them. Name of Shell Size of Man Relative Command Page (Bytes) Complexity Name Bourne Shell 44,500 1.00 sh C-Shell 76,816 1.73 csh Bash 127,361 2.86 bash Zsh 133,565 3.00 zsh Korn Shell 141,391 3.18 ksh Tcsh 199,834 4.49 tcsh
Relationships • Bourne • popular, simple, good scripting • extended versions include: • Bash, Korn, Zsh • the Bash shell is the common Linux shell • C-Shell • a good command interpreter • extended versions include Tcsh
3. The ‘usual’ Mix • Most UNIX users use: • C-Shell • for command processing • Bourne/Bash Shells • for writing scripts • We will discuss these; if you want to be a hacker then learn the others for yourself!
4. Changing your Shell • Temporary change by executing the shell command: $ csh • Return to the default shell with: $ exit or $ ctrl-D
Changing your Default Shell • Use chsh: chsh [-s name-of-shell] [userid] e.g. $ chsh $ chsh -s /bin/csh ad • chshis often disabled; then you must talk to the system administrator to change your shell.
Shells on calvin • $ cat /etc/shells • $ apropos shell | more • Also try $ whereis <shellname> $ locate <shellname> | more