hush/sleep.c

21 lines
392 B
C
Raw Normal View History

1999-10-05 16:24:54 +00:00
#include "internal.h"
#include <stdio.h>
1999-10-12 22:26:06 +00:00
const char sleep_usage[] = " NUMBER\n"
"Pause for NUMBER seconds.\n";
1999-10-05 16:24:54 +00:00
extern int
1999-10-12 22:26:06 +00:00
sleep_main(int argc, char * * argv)
1999-10-05 16:24:54 +00:00
{
1999-10-12 22:26:06 +00:00
if ( (argc < 2) || (**(argv+1) == '-') ) {
fprintf(stderr, "Usage: %s %s", *argv, sleep_usage);
exit(FALSE);
}
if ( sleep(atoi(*(++argv))) != 0 ) {
perror( "sleep");
exit (FALSE);
} else
exit (TRUE);
1999-10-05 16:24:54 +00:00
}