home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 40.6 System V.4 Batch Queues Chapter 40
Delayed Execution
Next: 40.8 Automatically Restarting at Jobs
 

40.7 Making Your at Jobs Quiet

Most modern versions of at will mail ( 1.33 ) you any output that your commands make. Some people try the command line below to throw that output into the UNIX trash can, /dev/null ( 13.14 ) :



>&
 

% 

at \f[CBO]sometime... >& /dev/null

     
...wrong

But that won't work because it throws away the output of the at command itself. at just saves your job in a file to be run later by a system program. The commands you want quiet are the commands stored in that file. One way to keep at quiet, if you use the C shell, is:

% 

at 



sometime



...


at> 

some command



 >& /dev/null


at> 

another command



 >& /dev/null


at> 

...etc...



 >& /dev/null


at> 
[CTRL-d]

The Bourne shell makes it easier:



exec >
 




$ 

at 



sometime



...


at> 

exec >



 /dev/null 2>&1


at> 

some command


at> 

another command


at> 

...etc...


at> 
[CTRL-d]

Two notes:

  • Some versions of at have a -s option that runs your job with the Bourne shell.

  • Not all versions of at prompt you with at> as I showed above.

- JP


Previous: 40.6 System V.4 Batch Queues UNIX Power Tools Next: 40.8 Automatically Restarting at Jobs
40.6 System V.4 Batch Queues Book Index 40.8 Automatically Restarting at Jobs

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System