Sponsored Content
Top Forums Shell Programming and Scripting Compare lines between two files Post 302977987 by RavinderSingh13 on Monday 25th of July 2016 05:19:16 AM
Old 07-25-2016
Hello Priya Amaresh,

Could you please try following and let me know if this helps you.
Code:
awk 'FNR==NR{A[$1];next} ($1 in A){print $0}' FS="=" executed.txt FS=" = " org_sysctl.txt

Output will be as follows.
Code:
d.cdrom.124 = 1
d.cdrom.12 = 600
d.cdrom.122 = 400
d.cdrom.34 = 200
d.cdrom.lo = 100

Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trying to compare lines in 2 files

Hello, I am new to scripting and need some help. In looking at other posts on this forum, I came up with the following logic. I cannot figure out why I am getting names of files of the current directory in my echo output. Scenario: message file has a line containing the version. Version.txt... (2 Replies)
Discussion started by: brdholman
2 Replies

2. Shell Programming and Scripting

compare files by lines and columns

Dear All, Is it possible to compare 2 files line to line using column values? for example I have file1: 1;givi;01012000;wer 2;sss;02012000;rrr 3;ccc;03012000;ttt file 2: 0;uuu;01012000;lll 1;givi;01012000;wer 2;sss;02012000;rrr 3;ccc;03012000;ttt 5;givi;01012000;hhh I want... (4 Replies)
Discussion started by: giviut
4 Replies

3. Shell Programming and Scripting

compare two files and to remove the matching lines on both the files

I have two files and need to compare the two files and to remove the matching lines from both the files (4 Replies)
Discussion started by: shellscripter
4 Replies

4. Shell Programming and Scripting

Compare lines in two files (Memory getting exhausted)

Hi, Could someone please help me with the best approach to compare lines from one file to another? Here is how I have entries - File 1 a1 a2 a3 a4 a9 a10 a15 File2 a5 a6 a15 (5 Replies)
Discussion started by: sncoupons
5 Replies

5. Shell Programming and Scripting

compare files and then remove some lines

Hi everyone I have a dilemma and I'm hoping someone has an answer for me. I have two files: # cat masterfile line3 line4 line5 line6 line7 # cat tempfile line1 line2 line3 line4 I want to compare tempfile with masterfile. (3 Replies)
Discussion started by: soliberus
3 Replies

6. Shell Programming and Scripting

Compare 2 files, 2 lines at a time

Hi Guys, I want to find any differences between packages installed on 2 servers/zones. I have 2 files that contain the output from pkginfo -x . I want to know if any packages exist only in one file and I want to also know about any packages that exist in both but with a different version. ie:... (8 Replies)
Discussion started by: Tornado
8 Replies

7. Shell Programming and Scripting

Compare files by lines and columns

Inspired by the extremely short awk code from Ygor on this post I wanted to compare two files on only one field. I can't get it to work. Can anybody help on explaining the code and fix the code? My code which does not work: awk 'BEGIN{a=1};a!=1' file1.txt file2.txt >outfile.txt file1.txt... (1 Reply)
Discussion started by: sdf
1 Replies

8. Shell Programming and Scripting

Compare two files with repeated lines

Hi all, I've been trying to write a script to compare two files. This is what I want: file 1: a 1 2 b 5 9 c 4 7 file 2: a a c a b Output: a 1 2 a 1 2 (2 Replies)
Discussion started by: ernesto561
2 Replies

9. UNIX for Dummies Questions & Answers

Compare lines in 2 files

I have 2 files with exactly the same information (with header and separated by ";") and what I would like to do is print (for both files!) the columns that are different and also print the "key" column that is equal in the 2 files For example, if File1: key1;aaa;bbb;ccc key2;ddd;eee;fff... (4 Replies)
Discussion started by: mvalonso
4 Replies

10. Shell Programming and Scripting

Compare two files and lines which are the same just delete it

I am having a two files and different days, and this is example: file1: 06.09.2017. abcd 123 file2: 07.09.2017. abcd 1234 So what I want is that file2 with today's date contains only 1234, so where is a problem you would ask? Problem is here that I put these commands into routers,. and... (3 Replies)
Discussion started by: tomislav91
3 Replies
APT-CDROM(8)								APT							      APT-CDROM(8)

NAME
apt-cdrom - APT CD-ROM management utility SYNOPSIS
apt-cdrom [-rmfan] [-d=cdrom_mount_point] [-o=config_string] [-c=config_file] {add | ident | {-v | --version} | {-h | --help}} DESCRIPTION
apt-cdrom is used to add a new CD-ROM to APT's list of available sources. apt-cdrom takes care of determining the structure of the disc as well as correcting for several possible mis-burns and verifying the index files. It is necessary to use apt-cdrom to add CDs to the APT system; it cannot be done by hand. Furthermore each disc in a multi-CD set must be inserted and scanned separately to account for possible mis-burns. Unless the -h, or --help option is given, one of the commands below must be present. add add is used to add a new disc to the source list. It will unmount the CD-ROM device, prompt for a disc to be inserted and then proceed to scan it and copy the index files. If the disc does not have a proper .disk directory you will be prompted for a descriptive title. APT uses a CD-ROM ID to track which disc is currently in the drive and maintains a database of these IDs in /var/lib/apt/cdroms.list ident A debugging tool to report the identity of the current disc as well as the stored file name OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no or several other variations. --no-auto-detect, --cdrom Do not try to auto-detect the CD-ROM path. Usually combined with the --cdrom option. Configuration Item: Acquire::cdrom::AutoDetect. -d, --cdrom Mount point; specify the location to mount the CD-ROM. This mount point must be listed in /etc/fstab and properly configured. Configuration Item: Acquire::cdrom::mount. -r, --rename Rename a disc; change the label of a disc or override the disc's given label. This option will cause apt-cdrom to prompt for a new label. Configuration Item: APT::CDROM::Rename. -m, --no-mount No mounting; prevent apt-cdrom from mounting and unmounting the mount point. Configuration Item: APT::CDROM::NoMount. -f, --fast Fast Copy; Assume the package files are valid and do not check every package. This option should be used only if apt-cdrom has been run on this disc before and did not detect any errors. Configuration Item: APT::CDROM::Fast. -a, --thorough Thorough Package Scan; This option may be needed with some old Debian 1.1/1.2 discs that have Package files in strange places. It takes much longer to scan the CD but will pick them all up. -n, --just-print, --recon, --no-act No Changes; Do not change the sources.list(5) file and do not write index files. Everything is still checked however. Configuration Item: APT::CDROM::NoAct. -h, --help Show a short usage summary. -v, --version Show the program version. -c, --config-file Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information. -o, --option Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options. SEE ALSO
apt.conf(5), apt-get(8), sources.list(5) DIAGNOSTICS
apt-cdrom returns zero on normal operation, decimal 100 on error. BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. AUTHORS
Jason Gunthorpe APT team NOTES
1. APT bug page http://bugs.debian.org/src:apt APT 1.6.3ubuntu0.1 30 November 2013 APT-CDROM(8)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy