Quote:
Originally Posted by
deco
Im using Ubuntu. My aim is just to list boot times in time interval which ı have entered. Can ı specialize last command? I can list boot times by using last command but as ı said ı want to see boot times in last 3 days for example.
Thank for your helps...
probably we are at the same class with this guy. he is trying to say this problem..
(20 pts) Write a shell script which includes a single argument which is a number.
Then, it will show the number of times that the computer was booted during last “number” of days
(including today).
Hint: This information is recorded somewhere in your system.
$myprog3 3
13/10/2010 booted 5 times
12/10/2010 booted 2 times
11/10/2010 booted 0 times
I solved the problem with my way. I took into array "last reboot" command. and i got the the day and month lines into process. than checked them how many times repeated and to limit the input counter, i checked today "%d" .
"kolay gele.."