90 likes | 230 Views
Linux Shells. Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux collard@cs.kent.edu. Command Line Interface. Start application programs File handling System administration Basically, layer over kernel API Scripting language
E N D
Linux Shells Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux collard@cs.kent.edu
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)
Thomson shell (sh) • Ken Thomson, 1971 • First Unix shell in the first release of Unix • Simple command interpreter • Not really a scripting language
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
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
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)
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)
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
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