-   Linux - Software (
-   -   what type does shutdown use to store seconds? (

dvm 12-15-2004 09:06 AM

what type does shutdown use to store seconds?
I want to shutdown the pc in 12-13 hours, so we're talking about 43800 seconds. Does shutdown use an int or a short int? I wouldn't want an overflow :)

Also, I remember reading about a command giving the first 10 lines from long lines of input. Can someone tell me which one was? Thanks

rjlee 12-15-2004 09:31 AM

The shutdown command uses minutes, not seconds, so you should be safe from overflows either way.

With the shutdown command, you can either specify the time as HH:MM (giving the clock time, not the length of time to wait), or as +690 to mean “wait 690 minutes from now”

The other command you're looking for is probably head, although it defaults to 20 lines.

cat somelongfile | head -n 10
will do the job. There's also a similar tail command that outputs the last lines.

dvm 12-15-2004 09:35 AM

Thanks, I hastilly looked at the man page, saw the -t sec option and thought, hmm, it's in seconds. I think I had read about tail, but head will do just as well. Thanks a lot :)

rjlee 12-15-2004 09:44 AM

The -t option is given to init, which can be used for an additional wait. Basically this can be used to give you shutdown resolution down to a second if you need it. e.g.:

shutdown -t2 00:01
This will start shutting down at two seconds past one minute past midnight.

All times are GMT -5. The time now is 03:37 AM.