Sponsored Content
Full Discussion: vi substitution
Top Forums Shell Programming and Scripting vi substitution Post 302469689 by Chubler_XL on Sunday 7th of November 2010 07:07:03 PM
Old 11-07-2010
If you don't have vim you can do with standard vi but it requires two replaces. First puts extra blank field in the 2nd last position, and 2nd populates year for those that have it:

Code:
%s/.*:/&:/
%s/\(.*\)\([0-9][0-9][0-9][0-9]\)\(.*\)::/\1\2\3:\2:/

You could get a little more specific and ensure date is only in 4th field, but your original replace didn't seem to worry about this. Perhaps 4 digit numbers never appear in fields 1-3?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

substitution

I am trying to substituted a variable to a file using sed. However, the value of that variable is not being substituted. Here is an example of my code. lf=' ' v_whole="${1} ${2} ${3} $lf" cp ${IPPDIR}/ctl/fax_sub_text_a.${4}.${5}.txt... (1 Reply)
Discussion started by: supercbw
1 Replies

2. UNIX for Dummies Questions & Answers

Need help in substitution!!!!

In a file I want to globally change a "|" charater by a new line character. I am using the command 1,$s/\|/??/g Can anybody say what should I put in place of ?? in the above command? (3 Replies)
Discussion started by: uLearner
3 Replies

3. Shell Programming and Scripting

Substitution using SED

Hi , I am stuck up in the below scenario:- I need to read a file name (eg A.txt) name frm another file (eg B.txt) and then I need to search for a particular expression in A.txt and substitute it with another expression. How can I use SED inside SHELL Scripting and command prompt as... (2 Replies)
Discussion started by: shubhranshu
2 Replies

4. Shell Programming and Scripting

SED Substitution

Hi , I am stuck up in the below scenario:- I need to read a file name (eg A.txt) name frm another file (eg B.txt) and then I need to search for a particular expression in A.txt and substitute it with another expression. How can I use SED inside SHELL Scripting and command prompt as well to... (1 Reply)
Discussion started by: shubhranshu
1 Replies

5. Shell Programming and Scripting

Difference between "Command substitution" and "Process substitution"

Hi, What is the actual difference between these two? Why the following code works for process substitution and fails for command substitution? while IFS= read -r line; do echo $line; done < <(cat file)executes successfully and display the contents of the file But, while IFS='\n' read -r... (3 Replies)
Discussion started by: royalibrahim
3 Replies

6. Shell Programming and Scripting

Substitution

All, I have this text document that contains a listing(See below). What i would like to ask is how i could extract just the information i need which is the files name (CWS*****.***.gz) If anyone has any suggestions i would be very grateful. I am sure its relatively simple but i just... (6 Replies)
Discussion started by: Andyp2704
6 Replies

7. UNIX for Dummies Questions & Answers

help with substitution

Hello, I have a file with 10,000+ records which look like this: Image3992170.tif 4/21/200811:42:09AM 3,373.13KB Image3993265.tif 4/11/20087:17:58PM 2,369.72KB Image3996764.tif 5/2/200811:01:28AM 2,155.87KB Image3997700.tif ... (4 Replies)
Discussion started by: lotusdeva
4 Replies

8. Shell Programming and Scripting

substitution help

How do i substitute ' with space in a file using sed or awk i am getting the following two scenarios 1) xyz'd with xyz d if i use sed 's/xyz\\\'d/xy z/g' it is taking ' after \ as closing expr for substitution 2) xyz';d with xyz d please advice (8 Replies)
Discussion started by: mad_man12
8 Replies

9. UNIX for Dummies Questions & Answers

vi substitution help

Hi experts, Could someone help me how to figure out the following substitution? I copied and pasted a column of names from an Excel file into another file in vi. The column of data has last names with dash (hyphens) and apostrophes. My goal is to do the following: 1) remove the apostrophes... (10 Replies)
Discussion started by: onlinelearner02
10 Replies

10. Shell Programming and Scripting

Substitution

I am trying to do some substitutions using the substitution operator (:%s) in a text file. I want to replace all A1, A2, A3.......A100 in my text file. I used :%s/A2/SAE/g successfully until A9 but when I use A1, all the A11 to A19 is changed. How do I specify the exact match here? (8 Replies)
Discussion started by: Kanja
8 Replies
dpkg-gencontrol(1)						    dpkg suite							dpkg-gencontrol(1)

NAME
dpkg-gencontrol - generate Debian control files SYNOPSIS
dpkg-gencontrol [option...] DESCRIPTION
dpkg-gencontrol reads information from an unpacked Debian source tree and generates a binary package control file (which defaults to debian/tmp/DEBIAN/control); during this process it will simplify the relation fields. Thus Pre-Depends, Depends, Recommends and Suggests are simplified in this order by removing dependencies which are known to be true according to the stronger dependencies already parsed. It will also remove any self-dependency (in fact it will remove any dependency which evaluates to true given the current version of the package as installed). Logically it keeps the intersection of multiple dependencies on the same package. The order of dependencies is preserved as best as possible: if any dependency must be discarded due to another dependency appearing further in the field, the superseding dependency will take the place of the discarded one. The other relation fields (Enhances, Conflicts, Breaks, Replaces and Provides) are also simplified individually by computing the union of the various dependencies when a package is listed multiple times in the field. dpkg-gencontrol also adds an entry for the binary package to debian/files. OPTIONS
-vversion Sets the version number of the binary package which will be generated. -Vname=value Set an output substitution variable. See deb-substvars(5) for discussion of output substitution. -Tsubstvars-file Read substitution variables in substvars-file; the default is debian/substvars. This option can be used multiple times to read substitution variables from multiple files (since dpkg 1.15.6). -Dfield=value Override or add an output control file field. -Ufield Remove an output control file field. -ccontrol-file Specifies the main source control file to read information from. The default is debian/control. -lchangelog-file Specifies the changelog file to read information from. The default is debian/changelog. -ffiles-list-file Read or write the list of files to be uploaded here, rather than using debian/files. -Fchangelog-format Specifies the format of the changelog. See dpkg-parsechangelog(1) for information about alternative formats. -ppackage Generate information for the binary package package. If the source control file lists only one binary package then this option may be omitted; otherwise it is essential to select which binary package's information to generate. -nfilename Assume the filename of the package will be filename instead of the normal package_version_arch.deb filename. -is, -ip, -isp These options are ignored for compatibility with older versions of the dpkg build scripts but are now deprecated. Previously they were used to tell dpkg-gencontrol to include the Section and Priority fields in the control file. This is now the default behaviour. If you want to get the old behaviour you can use the -U option to delete the fields from the control file. -Ppackage-build-dir Tells dpkg-source that the package is being built in package-build-dir instead of debian/tmp. This value is used to find the default value of the Installed-Size substitution variable and control file field (using du), and for the default location of the output file. -O[filename] Print the control file to standard output (or filename if specified, since dpkg 1.17.2), rather than to debian/tmp/DEBIAN/control (or package-build-dir/DEBIAN/control if -P was used). -?, --help Show the usage message and exit. --version Show the version and exit. FILES
debian/control The main source control information file, giving version-independent information about the source package and the binary packages it can produce. debian/files The list of generated files which are part of the upload being prepared. dpkg-gencontrol adds the presumed filenames of binary packages whose control files it generates here. SEE ALSO
deb-substvars(5), deb-src-control(5), deb-changelog(5), deb-control(5). 1.19.0.5 2018-04-16 dpkg-gencontrol(1)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy