Shell Commands/Newer

From MorphOS Library

Revision as of 12:27, 12 December 2015 by JPV (talk | contribs) (Created page with "'''Newer''' - Compares if a file is newer than an another file in shell scripts OLDFILE/A, NEWFILE/A, FILEDATES=DATES/S <nowiki> OLDFILE - An old existing file NEWFILE -...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Shell Commands

Newer - Compares if a file is newer than an another file in shell scripts

OLDFILE/A, NEWFILE/A, FILEDATES=DATES/S

OLDFILE   - An old existing file
NEWFILE   - A new file to be checked if it is newer than the old file
FILEDATES - Compares file dates if there isn't difference in the version string

If the NEWFILE is detected to be newer than the OLDFILE, the command exits with the return code 5.


Example:

Newer RAM:oldfile RAM:newfile DATES
If WARN
 Echo "The file is newer!"
EndIf