Up Next Previous

Automatic, periodic and timed events (+)

There are various ways to run commands and take other actions automatically at various times in the ``life cycle'' of the shell. They are summarized here, and described in detail under the appropriate Builtin commands, Special shell variables and Special aliases.

The sched builtin command puts commands in a scheduled-event list, to be executed by the shell at a given time.

The beepcmd, cwdcmd, periodic, precmd, postcmd, and jobcmd Special aliases can be set, respectively, to execute commands when the shell wants to ring the bell, when the working directory changes, every tperiod minutes, before each prompt, before each command gets executed, after each command gets executed, and when a job is started or is brought into the foreground.

The autologout shell variable can be set to log out or lock the shell after a given number of minutes of inactivity.

The mail shell variable can be set to check for new mail periodically.

The printexitvalue shell variable can be set to print the exit status of commands which exit with a status other than zero.

The rmstar shell variable can be set to ask the user, when `rm *' is typed, if that is really what was meant.

The time shell variable can be set to execute the time builtin command after the completion of any process that takes more than a given number of CPU seconds.

The watch and who shell variables can be set to report when selected users log in or out, and the log builtin command reports on those users at any time.

Up Next Previous