In testing it to see what's going wrong, the script has logic errors. It's comparing a file name to a checksum, and that makes no sense at all... It's also exiting with failure places I'd expect it to be returning success. It's also not bothering to use a lot of its own predefined variables and just using hardcoded names in places.
You don't need to read raw md5sums out of the file anyway, md5sum can verify things by itself.
It might even be possible to check for multiple files this way, by doing md5sum file1 file2 file3 ... > /tmp/.md5sum, though you'd have to start processing the output of md5sum -c, not just reading its return value, to tell which files didn't match.
/tmp/.md5sum might not be the best place to store this file. Your homedir may be better.
Last edited by Corona688; 01-23-2012 at 01:23 PM..
Hi what is the most optimum way to ftp the most recently modified file starting with a particular string.
i tried this
ftp -n 2>logfile 1>&2 <<EOF
open xxxxxx
user xxxx xxxx
prompt
ls -ltr f* res
!var=`tail -1 |awk { print $9 }'`
bye
EOF
that gives... (6 Replies)
Made changes to a file using vi editor and saved those changes
now realised that the changes are not required
How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Hello,
A couple of times per week, i receive emails notifications when files are available for processing.
Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Hi guys,
-could any one help me with this (I'm new to UNIX)
how to write a shell script that tell me the last modified file in the current directory?
so if I run the script in a diferent directory,will work.
and can I write the script by C++ language and run it in the shell ?
I tried... (5 Replies)
Hi,
I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10).
For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I... (16 Replies)
Hi all,
i need to write a shell script to transfer a file modified after a particular date from one server to another. I searched for the related posts in this forum and got hints and snippets for it. i tried the below code
ftp serverA
user uname pwd
lcd to_dir
cd from_dir
files=$(find... (7 Replies)
Hi,
I need to run a script file which uses a file and that file is modified as and when some alarms generated, it is not based on any fixed time period.. it may be modified even once in a minute for some time and once in 30 min or once in 20 min. Hence i need to watch for the timestamp change of... (3 Replies)
Hi,
I am looking for a shell script with the following.
1. It should check whether a particular file exists in a location
#!/bin/sh
if ;
then
echo "xxx.txt File Exists"
else
echo "File Not Found"
fi
2. If file exists, it should check for the modified date and run a command... (2 Replies)
Hi ,
I want a script who will send alert the moment someone edit any file in a directory in LINUX. Can some one throw some light on this please.!! (4 Replies)