Running into the Future



next up previous contents index
Next: The Make Utility Up: Interactive Shell Tips Previous: Stop and Go

Running into the Future

Sometimes you may not want to execute your job right now. It may be so demanding on the system as to ruin the response tim, or you may want to get home to a still-hot dinner and just know you won't if there's hot output. Here's an example of how to run the program happyBday at 8 AM on May 24, say,
       

% at 0800 may24 happyBday   	Run happyBday at time.   

The batch command is akin to at, yet batch has more intelligence. It will automatically queue your jobs and let only one run at a time. By using batch, you may submit a batch of jobs at once and not have them load down the system unreasonably or waste time by competing with each other to finish. To use batch, enter the batch command, then enter your Unix command in the same manner as you would from the command line, and then end your submission with a ^d:

% batch   	Enter the batch command.   
happyBday 2>& >outfile   	Enter the job.   
^d   	End submission with a ^d.   

When the job has completed, the system will send you mail. The command atq will show all batch-jobs in the queue or at-jobs waiting to be processed. If you want to put a command off for a while (say 200 seconds), try

% (sleep 20; command)&   	Run command after 20 seconds.   

Here the & places the command in the background. Semantically you'll see that there is another command which seems to belong here. The time command times how long it takes to execute a command, as for example:

% time happyBday   	Time how long to execute happyBday.   

We use the time command to see how long it takes to run our programs.   



next up previous contents index
Next: The Make Utility Up: Interactive Shell Tips Previous: Stop and Go