9
Linux Shells Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux [email protected] 1

Linux Shells

Embed Size (px)

DESCRIPTION

Linux Shells. Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux [email protected]. Command Line Interface. Start application programs File handling System administration Basically, layer over kernel API Scripting language - PowerPoint PPT Presentation

Citation preview

Page 1: Linux Shells

Linux Shells

Dr. Michael L. Collardwww.sdml.info/collard

www.sdml.info/collard/[email protected]

1

Page 2: Linux Shells

Command Line Interface

• Start application programs• File handling• System administration

• Basically, layer over kernel API• Scripting language• Internal (built-in to shell) and external

commands (separate programs)

Page 3: Linux Shells

Thomson shell (sh)

• Ken Thomson, 1971• First Unix shell in the first release of Unix• Simple command interpreter• Not really a scripting language

Page 4: Linux Shells

Bourne shell (sh)

• Stephen Bourne, ATT&T Bell Labs (1977)• /bin/sh - Replacement for Thomson shell• Released in 1977 as the default Unix shell of

Unix Version 7• Default shell for the root (superuser) account• Descendants: ksh, rc, bash, dash

Page 5: Linux Shells

C Shell (csh)• Bill Joy for BSD, 1978• Derived from Thomson shell (original sh)• Syntax modeled after C• Good job control features, history• tcsh – C shell (csh) with features, e.g., command-

line editing

• Typical usage:– C Shell (csh) for interactive use (or tcsh)– Bourne shell (sh) for scripting

Page 6: Linux Shells

Korn shell (ksh)

• David Korn, 1988 (ksh88)• Syntax of Bourne shell (sh) and features of C

Shell (csh)• Basis for POSIX shell• Ksh93• Variants: dtksh (part of CDE), tksh (with Tk)

Page 7: Linux Shells

Bash Shell (bash)

• “Bourne-Again” shell• GNU Project, 1987• Superset of Bourne shell (sh)• Features of C Shell (csh), and tcsh• Default for most modern Linux distributions,

Mac OS X, Cygwin• “bashisms” – features/behavior not in Bourne

shell (sh)

Page 8: Linux Shells

Other Shells• rc – replacement for sh on Plan 9• ash, Almquist shell, A Shell – clone for BSD of

much of Bourne shell• dash – Debian Almquist shell, faster then bash,

but no extensions (no “bashisms”)• esh – Easy Shell, Lisp based• scsh – Scheme shell• sash – Standalone shell, no reliance on external

libraries• zsh – Z Shell extension of Bourne shell

Page 9: Linux Shells

Current Practice

• /bin/sh – Bourne shell, default for root account

• /bin/bash – Bourne-Again shell, default for users

• Typically, /bin/sh alias for /bin/bash, but may not support same features

• /etc/shells – list of installed shells• Other shells provided for compatibility with

existing scripts