Sponsored Content
Top Forums Shell Programming and Scripting compare files in two directories and output changed files to third directory Post 302319984 by edgarvm on Tuesday 26th of May 2009 06:29:14 PM
Old 05-26-2009
This could be useful
Code:
#!/bin/sh
cd dist
for a in `ls`; do
   
   if [ ! -f "../dist_old/$a" ]; then
       continue
   fi
   diff $a ../dist_old/$a > /dev/null
   if [[ "$?" == "1" ]]; then
      cp $a ../dist_upgrade
   fi
done


Last edited by edgarvm; 05-26-2009 at 07:35 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare two flat files and get changed data

Hi, I need to compare two flat files (yesterday & today's data) and get only the changed data from flat files. In flat file i dont have data column or anything its just a string data in flat file.Can any one please let me know the script With Regds Shashi (3 Replies)
Discussion started by: jtshashidhar
3 Replies

2. Shell Programming and Scripting

mget * (obtein files from current directory but not the files form sub-directories)

Hello, Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories. The files names don't follow any defined rule, so they can be just letters without (.) period Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies

3. UNIX for Dummies Questions & Answers

compare all files under directories

Hello I am very new to Unix. I am actually using the C shell to write a program that will compare all the files in the directory and subdirectores and print out the ones that are identical, I am assuming identical by name or text Thank you (2 Replies)
Discussion started by: ga.miami56
2 Replies

4. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

5. UNIX for Dummies Questions & Answers

Compare files in two directories

Hi All, I have two directories that has some files, some of the files are common to both of them like : ls -l dir1 file1 file2 file3 ls -l dir2 file1 file2 file3 file4 file5 Now i want to get the files from dir2 that are not present in dir1 (means i want to get... (2 Replies)
Discussion started by: mukulverma2408
2 Replies

6. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

7. Shell Programming and Scripting

Compare files of 2 directories

Hi all, I have 2 directories dir1 and dir2 which contains many xml files. I need to compare files of dir1 with that of dir2 and if they match, I need to cut it from dir1 and paste it in dir2. I need to do this thru scripts. I'm currently investigating on the diff command. Please help me write... (6 Replies)
Discussion started by: frum
6 Replies

8. AIX

How to backup a directory (sub-directories/files) files from one server on to other ?

Hello, Server A: /directory1/ Server B: /Backups/ i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour. If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run. I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies

9. Shell Programming and Scripting

Compare files to pull changed records only

Hi, I am using Sun Solaris - SunOS. I have two fixed width files shown below. I am trying to find the changes in the records in the Newfile.txt for the records where the key column matches. The first column is a key column (example: A123). If there are any new or deletion of records in the... (4 Replies)
Discussion started by: Saanvi1
4 Replies

10. Shell Programming and Scripting

Compare directories and copy differences (files) in a another directory

Hey im working on script that can compare 2 directory and check difference, then copy difference files in third diretory. here is the story: in folder one we have 12 subfolder and in each of them near 500 images hosted. 01 02 03 04 05 06 07 08 09 10 11 12 in folder 2 we have same subfolder... (2 Replies)
Discussion started by: nimafire
2 Replies
Net::Google::Code::Issue(3pm)				User Contributed Perl Documentation			     Net::Google::Code::Issue(3pm)

NAME
Net::Google::Code::Issue - Google Code Issue SYNOPSIS
use Net::Google::Code::Issue; my $issue = Net::Google::Code::Issue->new( project => 'net-google-code' ); $issue->load(42); DESCRIPTION
ATTRIBUTES
project project name email, password user's email and password id status owner reporter reported merged stars closed cc summary description labels comments attachments INTERFACE
load parse updated the last comment's date. create comment, summary, status, owner, cc, labels, files. update comment, summary, status, owner, merge_into, cc, labels, blocked_on, files. list( q => '', can => '', author => '', id => '', label => '', max_results => '', owner => '', published_min => '', published_max => '', updated_min => '', updated_max => '', start_index => '' ) google's api way to get/search issues return a list of loaded issues in list context, a ref to the list otherwise. load_comments google's api way to get and load comments( no scraping is done here ) parse_hybrid when $USE_HYBRID is true, we will try to load issue with the google's official api, but as the api is not complete, we still need to do scraping to load something( e.g. attachments ), this method is used to do this. AUTHOR
sunnavy "<sunnavy@bestpractical.com>" LICENCE AND COPYRIGHT
Copyright 2008-2010 Best Practical Solutions. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-04-28 Net::Google::Code::Issue(3pm)
All times are GMT -4. The time now is 02:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy