I need help for this. I need to write a script that maintains a database of cryptographic checksums. In other words, I need this script to check the files checksum whether the files has been modified or not. But i got no idea where to start. Hope anyone here can guide me or provide an example related to my question. thanks
no..i mean write a bourne shell script that can store checksums of file into flat file.then can match the file's checksum with the checksum stored in flat file
Conceptually, those two tools are accomplishing exactly what you described in your OP. So using those as examples, you should be able to adapt to a shell script.
start with the command you want to use... this is "cksum" in your case. now you need to build the sum for one file... after that you've to check the next file... save the checksum to another flat file using ">>" maybe... start writing the first few lines of your script! you'll find a hell of a lot examples here or everywhere on the net.
if you're stuck and need help, just come back and ask...
i already implement that part..
but i've given some command lines that need to be included in script such as -a, -c, -f, -g, -x,etc and each command line got their use in the script.
---------- Post updated at 12:05 PM ---------- Previous update was at 10:06 AM ----------
and another thing.
how am i gonna match the checksum with database?
example, i already store checksum of file a into database..
then i need to match the checksum of a with checksum that stored inside database.
i try using comm command but not work...any idea?
---------- Post updated 09-07-09 at 02:13 AM ---------- Previous update was 09-06-09 at 12:05 PM ----------
i got anopther question
now i using case statement to handle getopt
but what i facing is eg.
case $i in
a) execute this
b) if a) never execute, then b) also wont execute codes
so how do i store the case a into variable then can bring it to case b?