three ways to run a program
ls -l
ls -l &
exec ls -l
redirections
ls -l >/dev/null </dev/null 3</dev/null
pipelines
ls -l | sort | wc
true && echo yes
sort <file | wc >output
|
three ways to run a program
(run (ls -l))
(& (ls -l))
(exec-epf (ls -l))
exec-epf replaces the current process
& forks the current process, then replaces the child
run forks and waits
redirections
(run (ls -l) (> /dev/null) (< /dev/null) (< 3 /dev/null))
(ls -l) is one kind of "process form".
with the redirections it becomes an "extended process form".
so run, &, exec-epf can actually take extended process forms.
all process forms are also extended process forms, with zero redirections.
pipelines
(run (| (ls -l) (sort) (wc)))
so (| pf1 pf2 pf3 ...) is also defined to be a process form.
(&& (true)
(echo yes))
similarly ||
unlike run, &, exec-epf, these take process forms, not extended process forms.
but you can make a process form from an extended one with "epf":
(epf (true) (> /dev/null))
is defined as a process form. so,
(&& (epf (true) (> /dev/null))
(echo yes))
is a way to add redirections for a process form within an && list.
(run (| (epf (sort) (< file))
(epf (wc) (> output)))
Now you're ready to read the Scsh Reference Manual's chapter on Process Notation.
|