1 / 9

What is a Shell

What is a Shell. A shell is a program that acts as the interface between the user and UNIX system It acts as an interpreter or translator It allows user to enter commands for the operation system to execute

mikel
Download Presentation

What is a Shell

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What is a Shell • A shell is a program that acts as the interface between the user and UNIX system • It acts as an interpreter or translator • It allows user to enter commands for the operation system to execute • It hides the details of the kernel’s operation from the user. So, < and > are used to redirect files, | to pipe up jobs, $(…) to output from a subprocess, etc. • Shells can be command-line-driven or graphical

  2. csh other programs kernel Hardware bash X windows System Shell Model

  3. Because UNIX is modular, there are many different shells in use. They are • Bourne shell (sh) • C shell (csh, tcsh and zsh) • Korn shell (ksh, pdksh) • Bourne Again shell (bash) • Rc • Except for the C shell, all of these are very similar • They are closely aligned with the shell specified in the X/open 4.2 and POSIX 1003.2 specifications

  4. POSIX lays down the minimum specification • X/Open extends the specification to provide a more friendly and powerful shell • To identify which shell is using: ps (process status) or echo $SHELL

  5. Pipes and Redirection • Input/Output Redirection • All CPU operations have I/O. The keyboard, for example, provides standard input (stndin), while the monitor displays standard output (stndout) and standard error (stnderr)

  6. Standard Output Command Standard Input Standard Error • Every UNIX command has a source for standard input and a destination for standard output • The input to a command normally comes from the keyboard, although it also can come from a file. The output from a command normally goes to the monitor or screen. Errors that might result from a command are another form of output and also are displayed on the screen

  7. The UNIX computing environment enables command I/O to be controlled using redirection • Output redirection uses the right angle bracket(>) $ ls –l > lsoutput.txt • To append to the file, >> operator could be used $ ps >> lsoutput.txt • Error output redirection uses the right angle bracket, preceded by the number 2 (2>) $ kill –HUP 1234 > killout.txt 2> error.txt • Input redirection uses the left angle bracket (<) $ more < killout.txt

  8. Standard Output Standard input Command Command | Pipe • Pipes • To connect processes together, use the pipe (|) operator • The pipe passes the standard output of one command as standard input into a following command • command | command • e.g.$ ps | sort > passort.out

More Related