see i wrote this..but i m getting diffrence 0 instead 5.. difference shoud
be five..

date -u | awk '{ print $4 }' > d1
date | awk '{ print $4 }' >> d1
cat d1 | awk '{sum = $1 - sum  } END {print sum}'  > 22

coz my date command output is 10:23:39
and date -u is                             15:23:39
date command showing US EST time rite now i m here in NY .

-Manish Popli


On 3/8/07, Manish Popli <[EMAIL PROTECTED]> wrote:
>
> see i wrote this..but i m getting diffrence 0 instead 5.. difference shoud
> be five..
>
> cat d1 | awk '{sum = $1 - sum  } END {print sum}'
> date -u | awk '{ print $4 }' > d1
> date | awk '{ print $4 }' >> d1
> cat d1 | awk '{sum = $1 - sum  } END {print sum}'  > 22
>
> coz my date command output is 10:23:39
> and date -u is                             15:23:39
> date command showing US EST time rite now i m here in NY .
>
>
>
>
>
> On 3/8/07, Gora Mohanty <[EMAIL PROTECTED]> wrote:
> >
> > On Thu, 2007-03-08 at 09:56 -0500, Manish Popli wrote:
> > > Hi Gora,
> > >
> > >
> > >
> > > Thanks for your reply Its entirely my mistake I din't provide
> > > sufficient information.
> > >
> > > I wrote :-
> > >
> > > #!/bin/sh
> > >
> > > Date > /manish
> > >
> > > Date –u >> /manish
> > >
> > > Awk '{print $4}' /manish
> > >
> > > ##############
> >
> > That still does not make any sense. Do you mean the system command
> > "date" instead of "Date"? "awk" instead of "Awk"? Case is important
> > in UNIX. In any case, the above set of commands would *not* give you
> > two columns of times as you said you had. Maybe, you should explain
> > what you are trying to do.
> >
> > > Now in out put I will get 2 different time I want the difference of
> > > these 2 time format
> >
> > If that is what you want, use the complete time, i.e., including date,
> > and use something like difftime() in the Perl POSIX module, assuming
> > that you want a scripting solution. There are too many gotchas in
> > trying to roll your own time difference function. Or, instead of
> > getting the time from date, use the various time functions available
> > in the Perl POSIX module, and all you need is a single script.
> >
> > Regards,
> > Gora
> >
> >
>
>
> --
> Manish Popli




-- 
Manish Popli
_______________________________________________
ilugd mailinglist -- ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/ilugd@lists.linux-delhi.org/

Reply via email to