The UNIX Shells - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

The UNIX Shells

Description:

File-substitution (similar to DOS) ? --- File-substitution (single character) | --- Pipe symbol (one out to another in) More Metacharacters ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 12
Provided by: scie235
Learn more at: http://cstl-csm.semo.edu
Category:
Tags: unix | dos | shells

less

Transcript and Presenter's Notes

Title: The UNIX Shells


1
The UNIX Shells
  • 1. What is a Unix shell?
  • 2. A few common shells in the Unix Linux.
  • A. Bourne shell
  • B. Korn shell
  • C. C shell
  • D. Bash-the default shell on most Linux

2
Korn Shell
C Shell
Common Core
Bourne Shell
3
Shell
User
Resident modules
Kernel
Hardware
4
Shell Functions (Core)
  • Built-in commands, Scripts, Redirection
  • Wildcards, Pipes, Subshells
  • Background processing
  • Command substitution
  • Variables (Local Environment)
  • Sequences (Conditional Unconditional)

5
Selecting A Shell
  • 1. Password is required to change shell
  • 2. Utility use chsh input password
  • Bunrne --- /bin/sh
  • C --- /bin/csh
  • Korn --- /bin/ksh (not avl. Here)
  • Bash --- /bin/bash (Default for most
  • of the
    Linux)

6
Utilities Shell Commands
  • In general, we dont differentiate utilities
    commands. In most of the books, both mean
  • the same thing.
  • They are utility programs to fulfill certain
    functions such as
  • Text editing, File manipulation, email

7
Metacharacters
  • gt --- Output redirection
  • gtgt --- Output redirection-append to a file
  • lt --- Input redirection (Read standard
  • input from a
    file)
  • --- File-substitution (similar to DOS)
  • ? --- File-substitution (single character)
  • --- Pipe symbol (one out to another in)

8
More Metacharacters
  • --- Conditional execution (executes a
  • command if the previous one fails)
  • --- Opposite to
  • ---Runs a command in the background
  • --- Comment
  • --- Expends the value of a variable
  • \ --- Disables the special meaning of next Char.

9
More Metacharacters
  • --- To sequence commands
  • () --- Groups commands
  • --- File substitution wildcard
  • command --- Command substitution replaced
  • by the output from
    command
  • ltlttok --- Input redirection reads standard input
  • from script up to tok

10
Examples
  • 1. cat gt file_1 You already familiar with
  • 2. cat gtgt file_1 appends new typed
  • contents to the existing file_1
  • 3. ls file list all files with file the first
    part
  • of the name
  • 4. ls ?ile2
  • 5. ls file3 wc
  • 6. sleep 30 sleep 30 second in the background

11
More examples of using metacharacters
  • date pwd ls cal--execute them in sequence
  • ls ac -- list any string beginning with a or
    c
  • echo the date today is date
  • ls /.c --- list all files ending in .c in any
  • subdirectory
  • ls A-Za-z --- list any string begin with a
    letter
Write a Comment
User Comments (0)
About PowerShow.com