Replace string of a file with a string of another file for matches using grep,sed,awk
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
for every package name I need to search in /tmp directory and replace it`s version from old version to new version and old release to new release:
How can I make it work for all packages in the comp.pkglist file to replace it`s old version to new version and old release to new release in any file under the directory /tmp.
The script should :
1) Run a loop with inputs as the name of the package in the comp.pkglist.
2) It should then grep for that package name in the /tmp directory to know which file contains the package.
3) Then it should replace old version/old release of the same package with new version.
Last edited by RudiC; 11-28-2018 at 07:38 AM..
Reason: Changed ICODE to CODE tags.
Ok, I'm stumped and can't seem to find relevant info.
(I'm not even sure, I might have asked something similar before.):
I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Hi Everyone,
I am new to this forum and new to sed/awk programming too !!
I need to find particular string in file1(text file) and replace it with a value from another text file(file2) the file2 has only one line and the value to be replaced with is in the second column.
file 1:
(assert (=... (21 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Hi experts,
In my text file I have the following alot of lines like below.
input.k is as follows.
2684717 -194.7050476 64.2345581 150.6500092 0 0
2684718 -213.1575623 62.7032242 150.6500092 0 0
*INCLUDE
$# filename... (3 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
I have a file example.txt as follows :SomeTextGoesHere
$$TODAY_DT=20140818
$$TODAY_DT=20140818
$$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script.
(It would even be better if I could pass... (5 Replies)
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
Hello
Take this file...
Test01
Ref test
Version 01
Test02
Ref test
Version 02
Test66
Ref test
Version 66
Test99
Ref test
Version 99
I want to substitute every occurrence of Test{2} with a unique random number, so for example, if I was using sed, substitution would be something... (1 Reply)
Discussion started by: funkman
1 Replies
LEARN ABOUT DEBIAN
d-shlibmove
d-shlibmove(1) d-shlibs manual d-shlibmove(1)NAME
d-shlibmove - Move shared library files around in Debian package creation process
SYNOPSIS
d-shlibmove [options] shared-library.so
DESCRIPTION
Call this program in debian/rules as a replacement of dh_movefiles for shared library packages.
It also checks debian/control for validity.
OPTIONS --movedev [filename] [relative dir-path]
Install file into relative directory path within the -dev package. The dir will be created with install -d and the file will be
moved.
--moveshl [filename] [relative dir-path]
Install file into relative directory path within the shared library runtime package. The dir will be created with install -d and
the file will be moved.
--movedevdoc [filename]
Install file into the documentation directory of -dev package. The dir will be created with install -d and the file will be moved.
Added in version 0.4
--extralib [shared-library.so]
Install the shared library in the same package as the main shared library.
--multiarch
By default d-shlibmove installs the shared library and any extralibs into /usr/lib. Add this flag to install them into
/usr/lib/<architecture-tripplet> instead.
Added in version 0.48
--commit
By default d-shlibmove runs in a dry-run mode. Add this flag to make the moving actually happen.
--suffix [suffix to add to shared library package]
Add a suffix to shared library package. This is a workaround when binary interface to package changed, and some fixup to Debian
packaging needs to be done.
Added in version 0.3
--devsuffix [suffix to add to development package]
Add a suffix to development package. For making incompatible development package.
--shlibs-local [current-version]
Create a debian/shlibs.local file to use, and specify current-version of shared library package. You need to remove
debian/shlibs.local, because this only appends to, not overwrite.
Added in version 0.3
--devunversioned
Install into unversioned development package.
Added in version 0.42
--ignorelibdep
Suppress shlib dependency. Useful when dynamically resolved e.g. using CDBS.
Added in version 0.42
--c102
Add c102 suffix to package names, for C++ ABI transition.
Added in version 0.8
--ldbl
Add dbl suffix to package names.
Added in version 0.35
--include-a
Install the *.a files. This is the default behavior.
Added in version 0.51
--exclude-a
Avoid installing *.a files.
Added in version 0.51
--include-la
Install the *.la files. This is the default behavior.
Added in version 0.45
--exclude-la
Avoid installing *.la files.
Added in version 0.45
--override [override statement]
Add an overriding sed expression, which looks like --override s/libshared1-dev/libshared-dev/. This expression is executed after
the other rules.
Multiple --override can be specified.
Added in version 0.30
EXIT CODE
Return 1 on error.
Return 2 on dry-run.
Return 0 on success.
EXAMPLES
The following is a sample command-line of a hypothetical package installation.
d-shlibmove --commit--movedev "debian/tmp/usr/include/*" usr/include --extralib debian/tmp/usr/lib/libhomeman-pthread.so
debian/tmp/usr/lib/libhomeman.so
AUTHOR
Junichi Uekawa <dancer@debian.org> <dancer@netfort.gr.jp>
SEE ALSO
d-devlibdeps (1)
Debian GNU/Linux 2002 May 3 d-shlibmove(1)