[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script for when system was last updated



On Monday 02 June 2008 22:57, Mumia W.. wrote:
> On 06/02/2008 01:14 PM, Nigel Henry wrote:
> > [...]
> > Could someone suggest a script I could put in ~/.kde/autostart that would
> > put up an xmessage saying when the system was last updated, when I boot
> > up Lenny?
> >
> > Much appreciation to all you scripting gurus out there.
> >
> > Nigel.
>
> I'm hardly a scripting guru, but this may help you a bit:
>
> #!/bin/bash
> hist_files="$HOME/tmp/tmp/history-files"
> lastupd=`ls $hist_files | sort -n | tail -1`
> xmessage "The system was last updated on $lastupd"

Hi. Thanks for the little script. I have a problem understanding the 
hist_files= line. The xmessage just says "The system was last updated on", 
and no date of the lastupdate is mentioned.

I ran ls /home/djmons/History-files | sort -n | tail -1, and the date of the 
latest file is printed out in the shell, so that bit is working ok.

I did change history-files to History-files on the hist_files= line, to 
reflect the correct name for the directory where the history files are kept, 
but no change. What does the /tmp/tmp signify on that line. It seems as if 
the path to where the history files are is not correct.

Nigel.



Reply to: