[OE-core] [PATCH v2] initscripts: fix timestamp check at bootmisc.sh

Henning Heinold heinold at inf.fu-berlin.de
Tue Dec 13 13:31:58 UTC 2011


On Tue, Dec 13, 2011 at 01:24:47PM +0000, Phil Blundell wrote:
> On Tue, 2011-12-13 at 15:18 +0200, Lauri Hintsala wrote:
> > On 12/13/2011 03:07 PM, Phil Blundell wrote:
> > > read RAWTIMESTAMP<  /etc/timestamp
> > > TIMESTAMP=${RAWTIMESTAMP#????????}${RAWTIMESTAMP%????????}
> >
> > Yes I got your idea and it seems to work. Thanks for your tips!
> > 
> > Second try:
> > 
> > SYSTEMDATE=`date -u +%4Y%2m%2d`
> > read TIMESTAMP < /etc/timestamp
> > if [ ${TIMESTAMP:8:4}${TIMESTAMP:0:4} -gt $SYSTEMDATE ]; then
> >      date -u $TIMESTAMP
> >      /etc/init.d/hwclock.sh stop
> > fi
> > 
> > Is this okay? Should I generate patch?
> 
> Is the "${var:X:Y}" substring notation part of POSIX?  I have a feeling
> that it might be a GNU extension, and it didn't seem to work in dash
> when I tried it just now.
> 
> p.

Substring using ${var:X:Y} is bash syntax as far as I know.

Bye Henning




More information about the Openembedded-core mailing list