Yes, the test utility operator -nt stands for newer than. If you check the man page for the test utility on your system or look for the term "conditional expression" on the man page for your shell, you'll find lots of useful tests that can be performed in your shell scripts. (Note that "conditional expression" might be all lowercase, all uppercase, or have the first letter of each word capitalized depending on which shell's man page you're reading.)
Most of the operators that are available with the [[ command (if your shell has a [[ command) are also available with the test utility invoked with:
or with:
The test and [ utilities are available with all Bourne shell derived shells.
Hi,
I have the following question :
As far as I know unix doesn't store file creation dates.
Would that imply the following?
tar -cvzf backup.tar --newer
is equal to:
tar -cvzf backup.tar --newer-mtime ? (1 Reply)
Howdy folks.
I have a problem - I'm sure the answer is very simple, but I can't work it out.
I want to create a UNIX shell script that does what I've been doing in DOS batch files for years - that is, backing up files. By which I mean copying files from a source directory to a target... (4 Replies)
Dear All,
I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. The condition is I dont know the full name of the first file. I searched google and this forum for any such examples, but couldn't find any or may be I would have... (9 Replies)
Hi,
I have a text file, foo.txt, it looks something like below. In the file there is a line that gives the date in the form of: Mon Jun 15 11:09:31 2008. I need to find which date is the newest and then store certain details of that list data to another file. So, in this sample text file, I... (6 Replies)
This should be a simple script, but can't find one with google search.
I just need to find the file that is in many directories, then overwrite that file with a newer version i.e.
find file.jar then overwrite with /root/file.jar
All I get in searches is substitute text with new test inside... (1 Reply)
Hello,
Can you please help me one this:
I have two servers: Server A and server B.
Every day on 03.00AM in only one on these two servers (randomly)is generated one file, lets say file.txt.
I want to copy this file also to the other server.
I want to create a perl script that does... (2 Replies)
Dear All,
I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. $3 $4 $5 $6 are files .txt. Help me please.
for i in $3 $4 $5 $6
do
if
then
echo "$1 is newer than $i"
else
echo "$i is newer than $1"
fi (9 Replies)
Discussion started by: Manueldo
9 Replies
LEARN ABOUT CENTOS
zipmerge
ZIPMERGE(1) General Commands Manual ZIPMERGE(1)NAME
zipmerge - merge zip archives
SYNOPSIS
zipmerge [-DhIiSsV] target-zip source-zip Op source-zip ...
DESCRIPTION
zipmerge merges the source zip archives source-zip into the target zip archive target-zip. By default, files in the source zip archives
overwrite existing files of the same name in the target zip archive.
Supported options:
-D Ignore directory components in file name comparisons.
-h Display a short help message and exit.
-I Ignore case in file name comparisons
-i Ask before overwriting files. See also -s.
-S Do not overwrite files that have the same size and CRC32 in both the source and target archives.
-s When -i is given, do not before overwriting files that have the same size and CRC32.
-V Display version information and exit.
EXIT STATUS
zipmerge exits 0 on success and 1 if an error occurred.
SEE ALSO zipcmp(1), ziptorrent(1), libzip(3)AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
NiH June 4, 2008 ZIPMERGE(1)