This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with date after date is modified in scripts


Raman Ravi <swcritic <at> yahoo.com> writes:

> 
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 
> > 
> 
> > > WOuld appreciate some help in understanding and more importantly resolving
> > > this issue.
> > 
> > This is a shortcoming in Cygwin itself.  You can only workaround it
> > by setting the date from a Cygwin process for now.  This will only
> > affect Cygwin processes running in the same user session, though.
> > There's a TODO in the affected code in Cygwin which describes this
> > very problem.  Unfortunately this requires a redesign of the code
> > in question...
> > 
> > Corinna
> > 
> 
> Hi Corinna,
> 
> Thanks for the reply (and information). I guess I have to retrieve the time
> using a "windows call" from my TMSERVER and then set the date/time back using
> date command in shutdown.sh
> 
> Thanks.
> Raman
> 
> 

Have a goofy solution but it works (if anybody else is interested)

1. Create a script to get the time string

getTimeStr

#!/bin/sh
net time "\\\\$TMSERVER"

2nd shell script "syncTime" contains

#!/bin/sh
TMSTR=`getTimeStr | grep Current | awk '{print $6,$7,$8}'`

date +"%m/%d/%Y %H:%M %p" -s "$TMSTR" >> $REG_DEV_NULL




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]