On Tue, 2011-12-13 at 14:58 +0200, Lauri Hintsala wrote:
> SYSTEMDATE=`date -u +%4Y%2m%2d`
> TIMESTAMP=`awk '{ print substr($0,9,4) substr($0,1,4); }' < /etc/timestamp`
> if [ $TIMESTAMP -gt $SYSTEMDATE ]; then
>       read TIMESTAMP < /etc/timestamp
>       date -u $TIMESTAMP
>       /etc/init.d/hwclock.sh stop
> fi
> 
> How about this?

You could lose the call to "awk" as well:

read RAWTIMESTAMP < /etc/timestamp
TIMESTAMP=${RAWTIMESTAMP#????????}${RAWTIMESTAMP%????????}

Or, er, something like that.  You might need to tweak the patterns a bit
depending on what exactly the format of /etc/timestamp actually is, but
I guess you get the idea.

p.



_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Reply via email to