![]() |
|
|
|
|
|||||||
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| report generation | gmahesh2k | UNIX for Dummies Questions & Answers | 2 | 05-15-2008 10:41 PM |
| awk- report generation from input file | McLan | Shell Programming and Scripting | 6 | 03-17-2008 01:34 AM |
| 2nd Generation SOA = EDA + CEP? | iBot | Complex Event Processing RSS News | 0 | 11-28-2007 04:30 PM |
| Shellcode Generation using C | Legend986 | High Level Programming | 2 | 10-07-2007 10:25 PM |
| Oracle Report generation | DILEEP410 | Shell Programming and Scripting | 7 | 01-04-2007 12:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I got a requirement in writing a KSH script in unix, please help me out the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2. I would like to compare all the similar files in the two folders and generate a report where this report should have filename and Matched(Y/N) If the files are similar then Y else N. Thanks in advance Mahesh |
| Forum Sponsor | ||
|
|
|
|||
|
try soemthing like this
Code:
for file in /folder1/*
do
file2="/folder2/`basename $file`"
if [[ -r $file2 ]] ; then
cksum $file | read one dummy1 dummy2
cksum $file2 read two dummy1 dummy2
echo "$file $file2 \c"
if [[ "$one" = "$two" ]] ; then
echo "Y"
else
echo "N"
fi
fi
done
|
| Thread Tools | |
| Display Modes | |
|
|