.\" Copyright (c) 2004 by Ian Piumarta .\" All rights reserved. .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the 'Software'), .\" to deal in the Software without restriction, including without limitation .\" the rights to use, copy, modify, merge, publish, distribute, and/or sell .\" copies of the Software, and to permit persons to whom the Software is .\" furnished to do so, provided that the above copyright notice(s) and this .\" permission notice appear in all copies of the Software. Acknowledgement .\" of the use of this Software in supporting documentation would be .\" appreciated but is not required. .\" .\" THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. .\" .\" Last edited: 2007-08-30 13:35:39 by piumarta on vps2.piumarta.com .\" .TH SAFE 1 "May 2004" "Version 1.0" .SH NAME safe \- execute a command with timeout .SH SYNOPSIS .B safe .B [\-timeout] .I command [args...] .SH DESCRIPTION .I safe runs the specified .I command with a timeout. If the .I command does not finish before the timeout expires, .I safe prints 'timeout' and kills the command. The default timeout is one second. .SH OPTIONS .I safe provides the following option: .TP .B \-timeout sets the timeout before the .I command is killed. The .B timeout is in seconds and can be a floating-point number for sub-second timeouts. If no .B timeout is specified then .I safe uses one second. .SH EXAMPLES The command .nf safe sleep 10 .fi will kill the .I sleep command after one second, whereas .nf safe -0.33 sleep 10 .fi will kill it after approximately one third of a second. .nf safe -5 sleep 1 .fi will run the sleep command to completion. Obviously, .I sleep is not a very interesting application of .IR safe . .SH SEE ALSO .IR kill (1). .SH AUTHOR .I safe and this manual page were written by Ian Piumarta (first-name at last-name dot com) based on the memory of something similar (with the same name) floating around the 'net in the late 1980s. .PP Please send bug reports and suggestions for improvements to the author at the above address.