confused by date
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > confused by date




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    confused by date  
mark_doherty@yahoo.co.uk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-07 06:26 AM

We are having problems with 'date' on our CX/UX version 7.1
Basically files created by 'cp' are 1 year old, whereas 'touch' creates
the file with the correct date.

Notice below that a has todays date, but b and sh.log are 1 year old!

Any ideas

#! /bin/ksh
rm a b
date > sh.log
touch a
cp a b
ls -l >> sh.log
date >> sh.log

more sh.log

Tue Jan 23 02:10:36 GMT 2007
total 4
-rw-rw-r--  1 flt      d61flt          0 Jan 23 02:10 a
-rwxrwxrwx  1 flt      d61flt         72 Jan 23  2006 a.sh
-rw-rw-r--  1 flt      d61flt          0 Jan 23  2006 b
-rw-rw-r--  1 flt      d61flt         29 Jan 23  2006 sh.log
Tue Jan 23 02:10:36 GMT 2007






[ Post a follow-up to this message ]



    Re: confused by date  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-07 12:47 PM

In article <1169519225.380744.274580@a75g2000cwd.googlegroups.com>,
mark_doherty@yahoo.co.uk wrote:

> We are having problems with 'date' on our CX/UX version 7.1
> Basically files created by 'cp' are 1 year old, whereas 'touch' creates
> the file with the correct date.
>
> Notice below that a has todays date, but b and sh.log are 1 year old!

Are you using a fileserver?  It looks to me like the date on the server
is wrong.  When you use "touch", it forcibly sets the modification time
to the current time on the client.  When you write to a file, the server
sets the modification time using its clock.

>
> Any ideas
>
> #! /bin/ksh
> rm a b
> date > sh.log
> touch a
> cp a b
> ls -l >> sh.log
> date >> sh.log
>
> more sh.log
>
> Tue Jan 23 02:10:36 GMT 2007
> total 4
> -rw-rw-r--  1 flt      d61flt          0 Jan 23 02:10 a
> -rwxrwxrwx  1 flt      d61flt         72 Jan 23  2006 a.sh
> -rw-rw-r--  1 flt      d61flt          0 Jan 23  2006 b
> -rw-rw-r--  1 flt      d61flt         29 Jan 23  2006 sh.log
> Tue Jan 23 02:10:36 GMT 2007

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:38 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register