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:

- JP


Previous: 40.6 System V.4 Batch Queues UNIX Power ToolsNext: 40.8 Automatically Restarting at Jobs
40.6 System V.4 Batch Queues Book Index40.8 Automatically Restarting at Jobs

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