Running processes in sequence |
|
Normally, if you type a command at the Unix prompt, that command runs to completion, and then when it is finished, you get another Unix prompt.
To execute multiple commands in sequence, place the commands on the same line, separated by semicolon (";") characters:
% insult_waiter;wake_up_neighbor;wreck_car
Unix will execute the insult_waiter command first.
When that is done, the wake_up_neighbor command
will be run. When that finishes, the wreck_car
process will be run, and then you will get another command prompt.
Note that you can redirect the input and output for a whole sequence of processes at once by grouping the commands in parentheses. For example, the command
% (insult_waiter;wake_up_neighbor;wreck_car) >twit.out
would cause the standard output for all three processes to be
redirected to file twit.out.
|
John Shipman, john@nmt.edu
Last updated: 1995/12/04 19:39:34 UT URL: http://www.nmt.edu/tcc/help/unix/seqprocess.html |
|