Help with file compare and move script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with file compare and move script
# 8  
Old 11-28-2018
WOW! Bakunin, Chubler and Don, thank you so much for the tour de force in explainiology. Aside from how helpful that was you folks renewed my faith in humanity. There are really good people out there and you're not just in that number, you're leading the pack.

That was better than I imagine a boot camp would be.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

2. Shell Programming and Scripting

Move file in to directory- script

Hi In directory /mnt/upload I have about 100 000 files (*.png) that have been created during the last six months. Now I need to move them to right folders. eg: file created on 2014-10-10 move to directory /mnt/upload/20141010 file created on 2014-11-11 move to directory /mnt/upload/20141111... (6 Replies)
Discussion started by: primo102
6 Replies

3. Shell Programming and Scripting

Shell script to get the latest file from the file list and move

Hi, Anybody help me to write a Shell Script Get the latest file from the file list based on created and then move to the target directory. Tried with the following script: got error. A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Discussion started by: saravan_an
2 Replies

4. Shell Programming and Scripting

Script to compare substrings of multiple filenames and move to different directory

Hi there, I am having trouble with a script I have written, which is designed to search through a directory for a header and payload file, retrieve a string from both filenames, compare this string and if it matches make a backup of the two files then move them to a different directory for... (1 Reply)
Discussion started by: alcurry
1 Replies

5. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

Hello all. I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b: I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused: I have all of my music stored in... (7 Replies)
Discussion started by: marcozd
7 Replies

6. Shell Programming and Scripting

script to move two lines to the end of a file

My input file is multiline file and I am writing a script to search for a pattern and move the line with the pattern and the next line to the end of the file. Since I am trying to learn awk, I thought I would try it. My input looks like the following: D #testpoint 1 510.0 D #testpoint2 ... (5 Replies)
Discussion started by: banjo25
5 Replies

7. Shell Programming and Scripting

Script to move the first line of a file to the end

I'm rather new to scripting, and despite my attempts at finding/writing a script to do what I need, I have not yet been successful. I have a file named "list.txt" of arbitrary length with contents in the following format: /home/user/Music/file1.mp3 /home/user/Music/file2.mp3... (21 Replies)
Discussion started by: Altay_H
21 Replies

8. Shell Programming and Scripting

script to move text in file?

ok i asked around to a few ppl and they said to use sed or awk to do what i want.. but i cant figure out how to use it like that.. anyway i have a text file that is 10k lines long.. i need to move text from the end of a line after the ? and move it to the front of the line then add a | after it.... (3 Replies)
Discussion started by: wckdkl0wn
3 Replies

9. UNIX for Dummies Questions & Answers

Compare directories then move similar ones

I would like to know how to compare a listing of directories that begin with the same four numbers ie. /1234cat /1234tree /1234fish and move all these directories into one directory Thanks in advance (2 Replies)
Discussion started by: tgibson2
2 Replies

10. Shell Programming and Scripting

File Compare & Move between 2 servers

Greetings - I am a newbie in shell scripts. I have been thru the whole forum but there has been no similar query posed. The objective of my system is to have a unified filebase system. I am using RSync to synchronise files between the location & central server with both of them having the... (4 Replies)
Discussion started by: evolve
4 Replies
Login or Register to Ask a Question
DEBDIFF(1)                                                    General Commands Manual                                                   DEBDIFF(1)

NAME
debdiff - compare file lists in two Debian packages SYNOPSIS
debdiff [options] debdiff [options] ... deb1 deb2 debdiff [options] ... changes1 changes2 debdiff [options] ... --from deb1a deb1b ... --to deb2a deb2b ... debdiff [options] ... dsc1 dsc2 DESCRIPTION
debdiff takes the names of two Debian package files (.debs or .udebs) on the command line and compares their contents (considering only the files in the main package, not the maintenance scripts). It shows which files have been introduced and which removed between the two pack- age files, and is therefore useful for spotting files which may have been inadvertently lost between revisions of the package. It also checks the file owners and permissions, and compares the control files of the two packages using the wdiff program. If no arguments are given, debdiff tries to compare the content of the current source directory with the last version of the package. debdiff can also handle changes between groups of .deb files in two ways. The first is to specify two .changes files. In this case, the .deb files listed in the .changes file will be compared, by taking the contents of all of the listed .deb files together. (The .deb files listed are assumed to be in the same directory as the .changes file.) The second way is to list the .deb files of interest specifically using the --from ... --to syntax. These both help if a package is broken up into smaller packages and one wishes to ensure that nothing is lost in the interim. debdiff examines the devscripts configuration files as described below. Command line options override the configuration file settings, though. If debdiff is passed two source packages (.dsc files) it will compare the contents of the source packages. If the source packages differ only in Debian revision number (that is, the .orig.tar.gz files are the same in the two .dsc files), then interdiff(1) will be used to com- pare the two patch files if this program is available on the system, otherwise a diff will be performed between the two source trees. OPTIONS
--dirs, -d The default mode of operation is to ignore directory names which appear in the file list, but they, too, will be considered if this option is given. --nodirs Ignore directory names which appear in the file list. This is the default and it can be used to override a configuration file set- ting. --move FROM TO, -m FROM TO It sometimes occurs that various files or directories are moved around between revisions. This can be handled using this option. There are two arguments, the first giving the location of the directory or file in the first package, and the second in the second. Any files in the first listing whose names begin with the first argument are treated as having that substituted for the second argu- ment when the file lists are compared. Any number of --move arguments may be given; they are processed in the order in which they appear. --move-regex FROM TO This is the same as --move, except that FROM is treated as a regular expression and the perl substitution command s/^FROM/TO/ is applied to the files. In particular, TO can make use of backreferences such as $1. --nocontrol debdiff will usually compare the respective control files of the packages using wdiff(1). This option suppresses this part of the processing. --control Compare the respective control files; this is the default, and it can be used to override a configuration file setting. --controlfiles FILE[,FILE ...] Specify which control files to compare; by default this is just control, but could include postinst, config and so on. Files will only be compared if they are present in both .debs being compared. The special value ALL compares all control files present in both packages, except for md5sums. This option can be used to override a configuration file setting. --wdiff-source-control When processing source packages, compare control files using wdiff. Equivalent to the --control option for binary packages. --no-wdiff-source-control Do not compare control files in source packages using wdfiff. This is the default. --wp, --wl, --wt Pass a -p, -l or -t option to wdiff respectively. (This yields the whole wdiff output rather than just the lines with any changes.) --show-moved If multiple .deb files are specified on the command line, either using .changes files or the --from/--to syntax, then this option will also show which files (if any) have moved between packages. (The package names are simply determined from the names of the .deb files.) --noshow-moved The default behaviour; can be used to override a configuration file setting. --renamed FROM TO If --show-moved is being used and a package has been renamed in the process, this command instructs debdiff to treat the package in the first list called FROM as if it were called TO. Multiple uses of this option are permitted. --exclude PATTERN Exclude files that match PATTERN. Multiple uses of this option are permitted. --diffstat Include the result of diffstat before the generated diff. --no-diffstat The default behaviour; can be used to override a configuration file setting. --auto-ver-sort When comparing source packages, do so in version order. --no-auto-ver-sort Compare source packages in the order they were passed on the command-line, even if that means comparing a package with a higher ver- sion against one with a lower version. This is the default behaviour. --unpack-tarballs When comparing source packages, also unpack tarballs found in the top level source directory to compare their contents along with the other files. This is the default behaviour. --no-unpack-tarballs Do not unpack tarballs inside source packages. --no-conf, --noconf Do not read any configuration files. This can only be used as the first option given on the command-line. --help, -h Show a summary of options. --version, -v Show version and copyright information. --quiet, -q Be quiet if no differences were found. --ignore-space, -w Ignore whitespace in diffs. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variables are: DEBDIFF_DIRS If this is set to yes, then it is the same as the --dirs command line parameter being used. DEBDIFF_CONTROL If this is set to no, then it is the same as the --nocontrol command line parameter being used. The default is yes. DEBDIFF_CONTROLFILES Which control files to compare, corresponding to the --controlfiles command line option. The default is control. DEBDIFF_SHOW_MOVED If this is set to yes, then it is the same as the --show-moved command line parameter being used. DEBDIFF_WDIFF_OPT This option will be passed to wdiff; it should be one of -p, -l or -t. DEBDIFF_SHOW_DIFFSTAT If this is set to yes, then it is the same as the --diffstat command line parameter being used. DEBDIFF_WDIFF_SOURCE_CONTROL If this is set to yes, then it is the same as the --wdiff-source-control command line parameter being used. DEBDIFF_AUTO_VER_SORT If this is set to yes, then it is the same as the --auto-ver-sort command line parameter being used. DEBDIFF_UNPACK_TARBALLS If this is set to no, then it is the same as the --no-unpack-tarballs command line parameter being used. EXIT VALUES
Normally the exit value will be 0 if no differences are reported and 1 if any are reported. If there is some fatal error, the exit code will be 255. SEE ALSO
dpkg-deb(1), wdiff(1), interdiff(1), diffstat(1) and devscripts.conf(5). AUTHOR
debdiff was originally written as a shell script by Yann Dirson <dirson@debian.org> and rewritten in Perl with many more features by Julian Gilbey <jdg@debian.org>. The software may be freely redistributed under the terms and conditions of the GNU General Public License, ver- sion 2. DEBIAN Debian Utilities DEBDIFF(1)