|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Date of file
I need to check whether my file is up to date or no...Can you tell me command in shell which helps to do it??? With example please.
|
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
What do you mean by 'up to date'? Modified today?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
NEWER...with IF test ...I guess yes.....
|
|
#4
|
|||
|
|||
|
Newer than what?
|
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Have a look at this page for the complete list of test-expression used with
if Code:
[[ -N filename ]] && echo yes || echo no -N option - True if FILE exists and has been modified since it was last read. I guess this is what you are looking for! |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Quote:
It does not work. It gives me only NO. $3 $4$5$6 my files file=$1 target=$2 while read line do if [ "$line" != "" ] then set $line if [ "$1" = "$target" ] then if [ "$2" = ":" ] then for i in $3 $4 $5 $6 do -N i && echo yes || echo no done fi fi fi done< $file ---------- Post updated at 01:19 PM ---------- Previous update was at 01:15 PM ---------- I found out whats wrong thank you for helping ![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| finding date numeral from file and check the validity of date format | manas_ranjan | Shell Programming and Scripting | 10 | 11-18-2011 02:58 PM |
| ksh compare dates INSIDE a file (ie date A is > date B) | right_coaster | Shell Programming and Scripting | 4 | 10-13-2011 11:53 PM |
| Delete a row from a file if one column containing a date is greater than the current system date | chumsky | UNIX for Dummies Questions & Answers | 4 | 07-06-2011 02:07 AM |
| finding the previous day date and creating a file with date | apple2685 | Shell Programming and Scripting | 4 | 05-17-2011 05:21 AM |
| Move A File With Same Date,don't Change The Desitination Dir Date | jee.ku2 | UNIX for Dummies Questions & Answers | 1 | 01-09-2008 12:42 PM |
|
|