The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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-16-2008 02:33 AM
awk- report generation from input file McLan Shell Programming and Scripting 6 03-17-2008 05:34 AM
2nd Generation SOA = EDA + CEP? iBot Complex Event Processing RSS News 0 11-28-2007 08:30 PM
Shellcode Generation using C Legend986 High Level Programming 2 10-08-2007 01:25 AM
Oracle Report generation DILEEP410 Shell Programming and Scripting 7 01-04-2007 04:52 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
gmahesh2k gmahesh2k is offline
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
  #2 (permalink)  
Old 05-16-2008
guruparan18 guruparan18 is offline
Registered User
  
 

Join Date: May 2008
Location: India
Posts: 37
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.
  #3 (permalink)  
Old 05-16-2008
penchal_boddu penchal_boddu is offline
Registered User
  
 

Join Date: Apr 2008
Location: Bangalore
Posts: 127
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0