title: Need guidance in writing a unix script to compare the files in source and target directories
body: <p>i want to write a unix script where:</p>
  
  <p>source dir:/test1/jobs/def1,def2,def3....so on
  target dir:/test2/jobs/def1,def2,def3....so on</p>
  
  <p>scenario1: i want to compare that jobs folder in source and target directory both has exactly same no of files like def1,def2,def3 and so on.. and if there is any file not found in target it should capture that discrepency in log file.</p>
  
  <p>scenario2: now once file level checking is done :</p>
  
  <p>source dir:/test1/jobs/def1,def2,def3,mam1,mam2,mam3,mam4,try1,try2,try3,cus1,cus2,cus3,kit1,kit2,kit3.....so on</p>
  
  <p>target dir:/test2/jobs/def1,def2,def3,mam1,mam2,mam3,mam4,try1,try2,try3,cus1,cus2,cus3,kit1,kit2,kit3.....so on</p>
  
  <p>now i need to write a script where i should pass input parameter on run time as string like for eg if i give 'def'than script should compare the content of files starting with def only from source to target not all others.. and if content is mis matched than it should be captured in my log file.</p>
  
  <p>Any help is much appreciated. Thanks in advance.
  J</p>