How about this solution, files system_1 and system_2 contain output of rpm -qa like this:
Code:
$ head -3 system_1
gnome-vfs2-smb-2.24.2-6.el6.x86_64
perl-XML-Parser-2.36-7.el6.x86_64
gnome-python2-desktop-2.28.0-5.el6.x86_64
$ head -3 system_2
hplip-libs-3.13.11-4.fc20.x86_64
gnu-free-fonts-common-20120503-8.fc20.noarch
GConf2-3.2.6-7.fc20.x86_64
In the below script specify the following in OPTS:
Code:
A - Package is Additional in file1
M - Package is Missing in file1
N - Version is Newer in file1
O - Version is Older in file1
S - Version is the Same in file1 and file2
D - Debug print version numbers with package names
And here is your code (options used here are Debug plus Newer and Additional in file1):
Code:
awk -v OPT=DNA '
FNR==1{sys++}
{
match($0,"-[0-9]")
pkg=substr($0,1,RSTART-1)
ver=substr($0,RSTART+1)
if (sys==1) {
PKGS[pkg]=ver
next
}
if(!(pkg in PKGS)) {
if(index(OPT, "M")) print "M:" pkg (index(OPT, "D") ? "(" ver ")":"")
next
}
if (index(OPT, "D")) debug="(" PKGS[pkg] " vrs " ver ")"
if (index(OPT, "N") && PKGS[pkg] > ver) print "N:" pkg debug
if (index(OPT, "O") && PKGS[pkg] < ver) print "O:" pkg debug
if (index(OPT, "S") && PKGS[pkg] == ver) print "S:" pkg debug
delete PKGS[pkg]
}
END {
if (index(OPT, "A")) for(pkg in PKGS) print "A:" pkg (index(OPT, "D") ? "(" PKGS[pkg] ")":"")
}' system_1 system_2
Output is <Type>:<package> , where <Type> is single letter from "NOMAS" and <package> is package name plus optional debug info.
I am getting the list of all the files which have "aaa" from files whose name is File*_bbb*.
grep -l "aaa" File*_bbb*
But I want to count the number of files. That is I want the total number of files which have "aaa" in
files File*_bbb*
If I run the following for getting number of... (1 Reply)
I am trying to find all files in a directory whose name has a real number larger then the number I am looking for.
For example:
.
|-- delta.1.5.sql
|-- delta.2.1.sql
|-- delta.2.2.sql
|-- delta.2.3.sql
|-- delta.2.4.sql
`-- delta.2.5.sql
I know my database is at 2.2 so I want an... (2 Replies)
I have a large Filesystem on an AIX server and another one on a Red Hat box. I have syncd the two filesystems using rsysnc.
What Im looking for is a script that would compare to the two filesystems to make sure the bits match up and the number of files match up.
its around 2.8 million... (5 Replies)
We have a list of files (raw and jpeg types) with 2 different extensions (rw2 and jpg).
When there is both the raw and jpeg files, their file numbers must be the same (215 and 215, 218 and 218).
Sometimes there is only the jpeg file (216,217).
bla_215.rw2
bla_215.jpg
bla_216.jpg
bla_217.jpg... (9 Replies)
Hello,
I've downloaded a huge amont of files
I've got a list of files from a remote server.
-rw-r--r-- 1 str661 strem 453465260 Dec 16 15:54 SATRYS2V1_20021218_temp_bias.nc
-rw-r--r-- 1 str661 strem 17669468 Dec 16 18:01 SATRYS2V1_20021225_hdyn_bias.nc
-rw-r--r-- 1... (9 Replies)
hi,
can somebody tell me how to compare names of files?
the situation is I have 2 files file1 and file2 and I want to figure out which file has the biggest ending, in this case file2 is.
thank you (3 Replies)
Hi,
Below are the 2 files in directory /tmp:
masterCSF242323.img
indexCSF242323.img
1) I want to compare if both the number (242323) are same in both the files. If they are same print - Files matching, else print files do not match.
2) Also if only index file is present in that... (7 Replies)
I have two files, "ranked.txt" and "sorted.txt". Sorted.txt is a smaller subset from ranked.txt that is sorted in alpha order. However ranked.txt preserves the ranking of words I would like to keep.
How do I check the rank of every word in sorted.txt when matched to the original ranked.txt? I... (8 Replies)
I need to compare two files (oldfile1 & newfile). Need to ignore the values which are present in both files. At the same time, i need to get only records in new file.
Tried using Join -v1 -v2 oldfile1 newfile (suspect it has not worked as expected).
could anyone of you please help me here. (5 Replies)
Hi,
I have a requirement to compare files in different directories with different names. The files have a datestamp in their name (It might not be a sequential datetimestamp).
This is for Redhat Linux. I have more than 5 directories and more than 10 file in each directory to be compared.
... (4 Replies)
Discussion started by: GosarJunk
4 Replies
LEARN ABOUT SUSE
pkg::create
pkg::create(n) Tcl Built-In Commands pkg::create(n)
__________________________________________________________________________________________________________________________________________________NAME
pkg::create - Construct an appropriate 'package ifneeded' command for a given package specification
SYNOPSIS
::pkg::create -name packageName -version packageVersion ?-load filespec? ... ?-source filespec? ...
_________________________________________________________________DESCRIPTION
::pkg::create is a utility procedure that is part of the standard Tcl library. It is used to create an appropriate package ifneeded com-
mand for a given package specification. It can be used to construct a pkgIndex.tcl file for use with the package mechanism.
OPTIONS
The parameters supported are:
-name packageName
This parameter specifies the name of the package. It is required.
-version packageVersion
This parameter specifies the version of the package. It is required.
-load filespec
This parameter specifies a binary library that must be loaded with the load command. filespec is a list with two elements. The
first element is the name of the file to load. The second, optional element is a list of commands supplied by loading that file.
If the list of procedures is empty or omitted, ::pkg::create will set up the library for direct loading (see pkg_mkIndex). Any num-
ber of -load parameters may be specified.
-source filespec
This parameter is similar to the -load parameter, except that it specifies a Tcl library that must be loaded with the source com-
mand. Any number of -source parameters may be specified.
At least one -load or -source parameter must be given.
SEE ALSO
package(n)
KEYWORDS
auto-load, index, package, version
Tcl 8.3 pkg::create(n)