Sponsored Content
Top Forums Shell Programming and Scripting comparing file content differences Post 80717 by aigles on Thursday 11th of August 2005 02:35:03 AM
Old 08-11-2005
$0 ~ "^\t"
Selects records starting with a tabulation character.
Those records contain lines that are in file 2 only.

All the code from awk ' to the last ' is awk code (perhaps nawk or gawk on your system).
You can't use these commands directly in a shell script.

An example of my script execution :

/path/to/previous_list
file1.c
file2.c
file3.c

/path/to/actual_list
file2.c
file3.c
file4.c
file5.c

Output
These files have been created
file4.c
file5.c
These files have been removed
file1.c

The two files /path/to/previous_list and /path/to/actual_list must be sorted (needs by the command comm)


Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

comparing the content of two directories

Hello I want to compare the content of two directories recursively to check if the two directories have the same files. How can I do that? (2 Replies)
Discussion started by: xyzt
2 Replies

2. Shell Programming and Scripting

Comparing files columnwise and print the differences in third file

Hello Everybody!!!!!!!!! Request you to help me with the below mentioned issue: I have 2 files say, File 1: a|4|7 b|3|2 c|8|8 d|8|9 File 2: a|4|6 b|2|2 c|8|8 d|9|8 The third file(output file) should have: Data mismatch in row 1 column 3 Data mismatch in row 2 coumn 2 Data... (3 Replies)
Discussion started by: abhijeet1409
3 Replies

3. Shell Programming and Scripting

Comparing content of two variables

I have very abstract need of "comparing two variables" and take subsequent actions. please refer to image below https://lh3.googleusercontent.com/-frNk5iA3q1c/TjI3lE0sWOI/AAAAAAAAAIE/fxzB1w07gas/script_block.JPG I have a part of script which reads a file and generates variables based on... (4 Replies)
Discussion started by: animesharma
4 Replies

4. Shell Programming and Scripting

Perl: Comparing to two files and displaying the differences

Hi, I'm new to perl and i have to write a perl script that will compare to log/txt files and display the differences. Unfortunately I'm not allowed to use any complied binaries or applications like diff or comm. So far i've across a code like this: use strict; use warnings; my $list1;... (2 Replies)
Discussion started by: dont_be_hasty
2 Replies

5. Shell Programming and Scripting

Comparing two files and list the differences

Hi * I have two text files which has the file size, timestamp and the file name. I need to compare these two files and get the differences in the output format. Can anyone help me out with this. * cat file1.txt *474742 Apr 18* 2010 sample.log *135098 Apr 18* 2010 Testfile 134282 Apr 18* 2010... (7 Replies)
Discussion started by: Sendhil.Kumaran
7 Replies

6. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

7. Shell Programming and Scripting

Help comparing 2 files and sending differences

I have 2 files that need to be compared. Email the differences if something is different and don't email if nothing is different. One or both of the files could be empty. One or both could have data in them. example files backup.doc.$(date +%y%m%d) file size is 0 backup.doc.$(TZ=CST+24... (4 Replies)
Discussion started by: jabbott3
4 Replies

8. Shell Programming and Scripting

Comparing 2 xml files and print the differences only in output

Hi....I'm having 2 xml files, one is having some special characters and another is a clean xml file does not have any special characters. Now I need one audit kind of file which will show me only from which line the special characters have been removed and the special characters. Can you please... (1 Reply)
Discussion started by: Krishanu Saha
1 Replies

9. Shell Programming and Scripting

Comparing file ownership/permission and content of files located on two different servers

Hi All, can some one suggest me a tool to compare file ownership/permission and contents of files located at two different unix servers? Thanks, Pranav (1 Reply)
Discussion started by: Pranav Bhasker
1 Replies

10. UNIX for Beginners Questions & Answers

Comparing time differences between 2 Solaris servers

Good day to all. I'm relatively new in using the Sun Solaris OS. I would like to request your expertise in helping to solve a problem that I have at work. Not sure if this has been asked before but I have tried searching through the internet to no avail. Basically I have 2 sun solaris... (8 Replies)
Discussion started by: Fossil_84
8 Replies
DH_METAINIT(1)						User Contributed Perl Documentation					    DH_METAINIT(1)

NAME
dh_metainit - install metainit files into package build directories SYNOPSIS
dh_metainit [debhelper options] [--name=name] [-n] [-o] DESCRIPTION
dh_metainit is a debhelper program that is responsible for installing metainit files (for further creation of initscripts via the update- metainit facility) into package build directories. It also automatically generates the postinst and postrm and prerm commands needed to create the appropriate initscripts for the init system employed on the user machine. Important: If generated postinst script finds /etc/init.d/ or /etc/default files with the same name as the shipped metainit files, and these are conffiles from non-installed packages (probably earlier version of this package) they are removed (or renamed if the user has modified them). This works only if the name of the new metainit is the same as the name of the old init.d and default file, otherwise you will have to remove these files yourself. See http://wiki.debian.org/DpkgConffileHandling for that. If a file named debian/package.metainit exists, then it is installed into etc/metainit/package in the package build directory, with "pack- age" replaced by the package name. OPTIONS
-n, --noscripts Do not modify postinst/postrm/prerm scripts. -o, --onlyscripts Only modify postinst/postrm/prerm scripts, do not actually install any metainit files. May be useful if the init script is shipped and/or installed by upstream in a way that doesn't make it easy to let dh_metainit find it. --name=name Install the metainit script using the filename name instead of the default filename, which is the package name. When this parameter is used, dh_metainit looks for and installs files named debian/package.name.metainit, instead of the usual debian/package.init. --error-handler=function Call the named shell function if running the init script fails. The function should be provided in the prerm and postinst scripts, before the #DEBHELPER# token. NOTES
Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause mul- tiple instances of the same text to be added to maintainer scripts. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Urs Ganse <urs@nerd2nerd.org> based on dh_installinit by Joey Hess <joeyh@debian.org> perl v5.8.8 2007-07-30 DH_METAINIT(1)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy