Sponsored Content
Full Discussion: File Replacement Help
Top Forums Shell Programming and Scripting File Replacement Help Post 302578225 by m.d.ludwig on Thursday 1st of December 2011 06:50:15 AM
Old 12-01-2011
How do you select which section in the base file is to be replaced by which section in the dependency file?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding a numeric value in a file for replacement

thank u optimus,but one more dout..it might be silly..how do i get the value in the file that should be replaced..while running the script..its an numeric value..that i want to change.. when i used sed for replacement ie. sed s/521000/100/p with print option it is printing... (4 Replies)
Discussion started by: Babu
4 Replies

2. Shell Programming and Scripting

Replacement of text in a file

Hi , I have some data in my file(properties.txt) like this. # agent.properties agent.dmp.Location= agent.name= I need to relpace the agent.dmp.location with agent.dmp.Location = /opt/VRTS/vxvm I am using the follwing to replace the string AGENT_NAME=snmp... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies

3. Shell Programming and Scripting

sed replacement in unicode file

Hi there, I have a file generated by a windows registry (it's unicode) and can't get to do some replacements on it. I want to join lines that end with backslash with the next one. santiago@ks354286:~$ cat win.reg ÿþWindows Registry Editor Version 5.00 ... (10 Replies)
Discussion started by: chebarbudo
10 Replies

4. Shell Programming and Scripting

Unix file pattern check and replacement

HI Guys , Using UNIX ,I intend to check with correct file pattern Access_file_Record.YYYYMM in path /tmp If the file exist in correct format come out from code . If not found check with different file patterns for same month period YYYYMM ( Like Access_file_Record_YYYYMM.txt or... (8 Replies)
Discussion started by: Perlbaby
8 Replies

5. Shell Programming and Scripting

sed replacement in file when line is in a variable

Hi, I have a file where I want to replace the 15th field separated by comma, only on specific lines matching lots of different conditions. I have managed to read the file line by line, within the loop my line is held in a variable called $line I assume this will be using sed (maybe... (5 Replies)
Discussion started by: jpt123
5 Replies

6. Shell Programming and Scripting

Conditional replacement of columns in a text file

Hello scriping expert friends, I have 2 requirements on replacing fields of text files: I have lot of data with contents like below: Requirement-1: The digit after 0 should always be changed to 1 (3 Replies)
Discussion started by: magnus29
3 Replies

7. UNIX for Dummies Questions & Answers

File size changes on replacement of certain numbers

I had a doubt regarding how the file size changes and needed some advice on the same So I have this file say abc.txt.. Size was 10000. Now inside the file when I go and I replace all the number 7 numerals with number 4 file size changed to 9984. Any idea why and how ?? (8 Replies)
Discussion started by: sidnow
8 Replies

8. Shell Programming and Scripting

Sed: how to use file contents in replacement string

I want to replace a string by contents of file. I am trying the following sed command: cat sample | sed "s^<enter description here>^`cat details`^" But it is not working. a=`cat details` and using $a will not help since it will affect the whitespaces. What am I missing in the above sed... (5 Replies)
Discussion started by: anand_bh
5 Replies

9. Shell Programming and Scripting

Replacement of variable by their content in a file

Dear all, I have a "SQL request" in a file: that request include different "host variable" and I would like to substitute the different "host variable" by their respective content before executing the request. For example: $ echo $SHELL /bin/bash $ cat dae2.txt DELETE FROM ... (11 Replies)
Discussion started by: dae
11 Replies

10. Shell Programming and Scripting

Replacement Query in a file

Hi All, Please can you help me with below, i have a file with records ( eg of one record below) Record R1 - The field separtaor between records is | (Pipe) |123|Mukesh\r\n|Vivek"sharma| Now i want to do the following for each record in the file if there is any field ( lets say field... (3 Replies)
Discussion started by: mad_man12
3 Replies
DH_SAMEVERSIONDEP(1)					User Contributed Perl Documentation				      DH_SAMEVERSIONDEP(1)

NAME
dh_sameversiondep - generate versioned dependency based on the versioned dependencies of the reference package. SYNOPSIS
dh_sameversiondep [debhelper options] DESCRIPTION
dh_sameversiondep is a helper tool which is able to generate a dependency that is versioned the same way as a dependency (coming from the same source) of another reference package. dh_sameversiondep scans debian/control for the specially formatted substvar (see "sameVersionDep substvar SPECIFICATION" section below), determines its value and writes it to debian/package.substvars file. The most common use case for dh_sameversiondep tool is to keep your liba-dev package dependency on the external libb-dev package as tight as your liba package depends on the respective external libb package (see "EXAMPLE" section for more information about this use case). dh_sameversiondep works as follows: o Searches for the sameVersionDep substvar in the Depends, Recommends, Suggests, Enhances and Pre-Depends fields of the requested packages. When one is found, it is parsed and the dependency package name, reference package name and dependency type (either Depends or Recommends etc.) are determined. o All dependencies of the requested type are collected for the dependency package based on the dpkg-query --status output. o All dependencies of the requested type are collected for the reference package either from debian/control (substvars are expanded) or from dpkg-query --status output if the package was not found in debian/control. o Both collections are intersected leaving only common packages in both collections. o Common package list is filtered by leaving only those which come from the same source as dependency package. o Whatever packages are left (most likely only one), their names are replaced with dependency package name preserving all versioning information. This result is written to debian/package.substvars file as a value of the sameVersionDep substvar being processed. dh_sameversiondep is very strict about errors. If either dependency package or the reference package cannot be found or the resulting dependency set is empty, it will fail with an error. dh_sameversiondep MUST be run before dh_gencontrol. However, it is recommended to run dh_sameversiondep after dh_shlibdeps. sameVersionDep substvar SPECIFICATION sameVersionDep substvar can appear in either Depends, Recommends, Suggests, Enhances or Pre-Depends field of any binary package. The field, which the substvar appears in, becomes the default dependency type for that substvar. sameVersionDep should be formatted as follows (everything is case sensitive): ${sameVersionDep:dependency[[:reference]-dependency type]} dependency (mandatory) The name of the package which you want to add as a dependency. reference (optional) The name of the package which dependencies are to be intersected with the dependencies of the dependency package. Defaults to the first package in debian/control if ommited. dependency type (optional) Can be either Depends, Recommends, Suggests, Enhances or Pre-Depends. Defaults to the name of the field which the substvar was found in. Specifies which type of dependencies to consider when analyzing dependency package and reference package. EXAMPLE
Assume we have the following in debian/control: Package: liba Depends: libc (>= 0.1), depa, depb, depc Package: libb Depends: libd (>= 0.2), depd, depe, depf Package: libab-dev Depends: ${sameVersionDep:libc-dev}, ${sameVersionDep:libd-dev:libb} Assumming that libc and libc-dev (both from the same source), as well as libd and libd-dev (both from the same source) are installed, the value of "sameVersionDep:libc-dev" will be libc-dev (>= 0.1) and the value of "sameVersionDep:libd-dev:libb" will be libd-dev (>= 0.2). "sameVersionDep:libc-dev" could also be written as "sameVersionDep:libc-dev:liba-Depends" and "sameVersionDep:libd-dev:libb" as "sameVersionDep:libd-dev:libb-Depends" but it is not necessary because defaults are sufficient. SEE ALSO
debhelper(7) AUTHOR
Modestas Vainius <modax@debian.org> perl v5.14.2 2012-08-05 DH_SAMEVERSIONDEP(1)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy