Bourne shell
Overview
The Bourne shell is the traditional Unix shell originally written by Stephen Bourne.
v7 il the first official releae on UNIX systems and is the reference for SUS 03 spécifications
NOTICE Shell on SUS 03 and above is not strictly Bourne Shell v7 but an improved version
Metacharacters
; & ( ) | < > newline space tab newline
Control operators
; & && || newline
Commands
Builtin
- for name [in word …] do list done
- case word in [pattern [ | pattern ] … ) list ;;] … esac
- if list then list [elif list then list] … [else list] fi
- while list [do list] done
- ( list )
- { list }
Special
- :
- . file
- break [n]
- continue [n]
- cd [arg]
- eval [arg …]
- exec [arg …]
- exit [n]
- export [name …]
- login [arg …]
- newgrp [arg …]
- read name …
- readonly [name …]
- set [-eknptuvx [arg …]]
- shift
- times
- trap [arg] [n] …
- umask [ nnn ]
- wait [n]
Parameters
- ${parameter} sequence of letters, digits or under- scores (a name), a digit, or any of the characters * @ # ? - **$** !
- ${parameter-word}
- ${parameter=word}
- ${parameter?word}
- ${parameter+word}
Variables
- Automatically set: #, -, ?, $, !
- Used but not set: HOME, PATH, MAIL, PS1, PS2, IFS