The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Report generation gmahesh2k Shell Programming and Scripting 3 05-15-2008 11:33 PM
awk- report generation from input file McLan Shell Programming and Scripting 6 03-17-2008 02:34 AM
2nd Generation SOA = EDA + CEP? iBot Complex Event Processing RSS News 0 11-28-2007 05: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 01:52 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Posts: 8
report generation

Hello,
I got a requirement in writing a sheel 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
Reply With Quote
Forum Sponsor
  #2  
Old 05-15-2008
Registered User
 

Join Date: May 2008
Location: India
Posts: 30
Hi...

Few doubts..

Quote:
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)
What do you mean by matching? What condition? You look only for filename or file content?

Quote:
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.
So F1 & F2 contains the same file. And what is
Quote:
here are same files in the different folders.
? Bit confussing.
Reply With Quote
  #3  
Old 05-15-2008
Registered User
 

Join Date: Apr 2008
Location: Bangalore
Posts: 123
Hi try this,

If ur in folder1, then

echo " Filename Matched(Y/N) " >> Output_file

for i in `ls`
do
diff $i path_0f_folder2/.
if [ $? -eq 0 ]
then
echo " $i Y" >> Output_file
else
echo " $i N" >> Output_file
fi
done


Thanks
Penchal
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0