Sponsored Content
Full Discussion: Help with MD5 script
Top Forums Shell Programming and Scripting Help with MD5 script Post 302611919 by TheBarnacle on Friday 23rd of March 2012 08:29:31 PM
Old 03-23-2012
Help with MD5 script

Hi, I tried to write script, which would be able to generate MD5 sums into txt file.. But It won't work.. (I've been trying to fix that over 4 hours, but nothing helps)

Here it is
Code:
#!/bin/bash


 FILE="nothing1"
 POST="nothing2"
 I=1

 while [ "$FILE" != "$POST" ]
 do


FILE=`ls -ltR | grep "^-" | tr -s " " | cut -f9 -d" " | head
 -$I | tail -1`


`md5sum $FILE >> md5sum.txt`


 I=$((I + 1))

POST=`ls -ltR | grep "^-" | tr -s " " | cut -f9 -d" " | head
 -$I | tail -1`

done


The thing is, that its always save just fmd5 of first file.. Problem is somewhere here "`ls -ltR | grep "^-" | tr -s " " | cut -f9 -d" " | head
-$I | tail -1`", because.. If I put it into command line it get right result.. but If it's in script.. It gets all wrong..:-(

Thanks for any help..:-)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Md5

Does anyone know a scipt that includes MD5. I need to run a script that includes MD5 encryption. Thanks (1 Reply)
Discussion started by: duncang3
1 Replies

2. UNIX for Advanced & Expert Users

Digest MD5

Dear Guys , Am sorry i ask alot , but i do not know that much about perl , cgi , MD5 ! now i installed MD5 and Digest MD5 to my solaries 7 sparc machine . when i execute the command : $perl Makefile.PL i get the follwoing error message ,, please tell me how to fix it , i need... (11 Replies)
Discussion started by: tamemi
11 Replies

3. Linux

Need Help: MD5

I am trying to compare two identical files by using md5 command, but cant get the right command parameters Please help me with any examples. All I want is to know how to compare two identical files which are residing on two different machines in my local network, for example: Host_A -... (6 Replies)
Discussion started by: greenja
6 Replies

4. Shell Programming and Scripting

[Bash] MD5 Checks with Script.

Hi. I'm triyng to make a Bash Script that checks (recursively) the MD5 from all the files in a certain directory and compare them against some other check that should be already done and saved in a file. I've reached to the point where i have the MD5 from the file and the MD5 that the script... (1 Reply)
Discussion started by: BiFo
1 Replies

5. Shell Programming and Scripting

Need to create a simple script using MD5, SSH...

Hi all, I am brand new to these forums and I am a brand new UNIX Administartor. Don't know any scripting yet :wall:, and would like to learn as my boss is slowly letting me understand everything about being a Sys/*Nix Admin. He created this script which I am trying to replicate because I lost it... (54 Replies)
Discussion started by: zixzix01
54 Replies

6. UNIX Desktop Questions & Answers

Script to compare md5

From couple of hours i try to do a script to compare file MD5. Help would be very appreciated :) First i read the md5 stored into a text file (no problem): md5=`grep -P "^{32}" $file` then i want to calculate the checksum and store it : cmd5=`md5sum licence.gvcl` then problems arrives, i... (5 Replies)
Discussion started by: giova
5 Replies

7. Shell Programming and Scripting

Create md5 sums and archive the resulting md5 files

Hello everyone, I am looking to basically creating md5sum files for all iso files in a directory and archive the resulting md5 files into a single archive in that very same directory. I worked out a clumsy solution such as: #find files for which md5sum are to be created and store the... (1 Reply)
Discussion started by: SurfTranquille
1 Replies

8. Solaris

md5 checksum what does it do

Hello good people, I came across md5 checksum. Can anyone please explain to me what it does and if possible an example of how to use it? Thank you very much (1 Reply)
Discussion started by: cjashu
1 Replies

9. Shell Programming and Scripting

scp script with MD5

I have more than one file in my directory & I want to SCP them all with MD5 verification of local & remote file, Problem is that the script gets stop after scp one file. Below is the code. #!/usr/bin/bash cd /application/datafolder/my/ ls > my_file_list.txt while read fname do ... (7 Replies)
Discussion started by: m_raheelahmed
7 Replies

10. Shell Programming and Scripting

How to reverse the b64 format(encoded b64(b64(md5($pass)))) into md5 hash format?

I have about 1500 rows (encoded b64(b64(md5($pass))) algorythm) in a file. I would like reverse the b64 into md5 hash format. How could I do that from command line? So I need only the correct md5 hash formats. These row format: 4G5qc2WQzGES6QkWAUgl5w P9tKxonBOg3ymr8vOBLnDA... (1 Reply)
Discussion started by: freeroute
1 Replies
MKIMAGE(1)						      General Commands Manual							MKIMAGE(1)

NAME
mkimage - Create an ISO image from jigdo files SYNOPSIS
mkimage -j igdo -t emplate [options]... mkimage -t emplate -z [options]... mkimage -f d5-list -t emplate -M issing-list [options]... DESCRIPTION
mkimage knows how to parse a jigdo template file, commonly used when creating Debian CDs and DVDs. It can be used to actually convert a template file and associated files into an ISO image (hence the name mkimage), or with some command line options it will output useful information about the template file instead. -t template file The jigdo .template file is the most important thing that mkimage needs, and must be specified for all operations. -j jigdo file The jigdo .jigdo file will normally acompany the .template file. To rebuild the image you must specify at least one of the jigdo file and an MD5 file (-f). -f MD5 file A file listing files available locally and their MD5 sums, in the same format as used by genisoimage: MD5sum File size Path 32 chars 12 chars to end of line The MD5sum must be written in standard hexadecimal notation, the file size must list the size of the file in bytes, and the path must list the absolute path to the file. For example: 00006dcd58ff0756c36d2efae21be376 14736 /mirror/debian/file1 000635c69b254a1be8badcec3a8d05c1 211822 /mirror/debian/file2 00083436a3899a09633fc1026ef1e66e 22762 /mirror/debian/file3 To rebuild an image you must specify at least one of the MD5 file and a jigdo file (-j). -m item=path Used in conjunction with a jigdo file; specify where mkimage should look on the local filesystem to find the files it needs to make an image. (e.g. "Debian=/mirror/debian"). -M missing file If you're not sure if you have all the files needs to create an image, specify both the jigdo file and an MD5 file along with the template file and -M <file>. mkimage will check to see that all the files are available instead of building the image. Any files that are missing will be listed in the file specified here. See jigit for usage examples. -v Make mkimage more verbose. Additional -v arguments will make it more verbose again. Default level is 0 (almost no output). 1 will print progress in % while the image is being created; 2 will list every file and data block that is appended to the image. -l logfile mkimage will normally write to stderr when it reports progress. Specify a logfile (or /dev/null) if you want it elsewhere. -O Skip checking the validity of specified jigdo files. mkimage will normally check for the "JigsawDownload" header as a sanity check, but some very old jigdo files produced by Debian pre-dated the addition of this header. -o outfile mkimage will normally write the ISO image to stdout, ready for piping into cdrecord or to iso-image.pl. Specify an output filename if you want it written to disk instead. -q mkimage will normally check the MD5 sum of every file it reads and writes, and will fail if it finds any mismatches. Specify -q to tell it not to. This will normally run more quickly, but can leave you with a broken image so is POTENTIALLY DANGEROUS. Use with care! -s start offset Rather than start at the beginning of the image, skip to the specified offset and start output there. Probably only useful in iso- image.pl when resuming a download. Specifying a non-zero offset also implies -q, as it's difficult to check MD5 sums when you're not checking the whole image. -e end offset Rather than end at the end of the image, stop at the specified offset. Probably only useful in iso-image.pl when resuming a download. Specifying an end offset also implies -q, as it's difficult to check MD5 sums when you're not checking the whole image. -z Simply parse the template file and print the size of the image that would be generated, in bytes. Only needs the template file to be specified, any other arguments will ignored. EXAMPLES
mkimage -f MD5 -j test.jigdo -t test.template -M missing Read in the files MD5, test.jigdo and test.template and check if all the needed files are available. If any are missing, list them in missing. mkimage -z -t test.template Find out how big the ISO image would be from expanding test.template. mkimage -v -f MD5 -t test.template -o test.iso Build the iso image in test.iso, using files listed in MD5 to fill in what's needed by the template file test.template. Show progress as the image is built. SEE ALSO
jigdo-file(1), jigit(1), jigsum(1) and jigdump(1). COPYRIGHT
Copyright 2004 Steve McIntyre (steve@einval.com) mkimage may be copied under the terms and conditions of version 2 of the GNU General Public License, as published by the Free Software Foundation (Cambridge, MA, USA). AUTHOR
Written by Steve McIntyre (steve@einval.com) Jigit jigdo tools September 2004 MKIMAGE(1)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy