-- front
6.828 Shells Lecture
Hello.
-- intro
Bourne shell
Simplest shell: run cmd arg arg ...
fork
exec in child
wait in parent
More functionality:
file redirection: cmd >file
open file as fd 1 in child before exec
Still more functionality:
pipes: cmd | cmd | cmd ...
create pipe,
run first cmd with pipe on fd 1,
run second cmd with other end of pipe on fd 0
More Bourne arcana:
$* - command args
"$@" - unexpanded command args
environment variables
macro substitution
if, while, for
||
&&
"foo $x"
'foo $x'
`cat foo`
-- rc
Rc Shell
No reparsing of input (except explicit eval).
Variables as explicit lists.
Explicit concatenation.
Multiple input pipes <{cmd} - pass /dev/fd/4 as file name.
Syntax more like C, less like Algol.
diff <{echo hi} <{echo bye}
-- es
Es shell
rc++