Sponsored Content
Full Discussion: Help with inserting a line
Top Forums Shell Programming and Scripting Help with inserting a line Post 302458350 by bartus11 on Thursday 30th of September 2010 12:52:02 PM
Old 09-30-2010
Code:
perl -i -0pe '$_="header\n" . $_' *

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

inserting line??

guys can anyone tel me how to insert a line in a file(bash) using line number i wanna insert the line using LINE NUMBER...i know for inserting above or below a perticular line we can use sed a\ or i\.... thanks in advance.... (7 Replies)
Discussion started by: anj
7 Replies

2. Shell Programming and Scripting

Inserting a new line

I have a file where each line starts with a "update" statement. I want to insert a new line, after each line, with the words "go" in the new line. Can someone help me out with this? (1 Reply)
Discussion started by: ssmallya
1 Replies

3. Shell Programming and Scripting

inserting a line after a perticular line

Hi, Suppose I have a file which contains many lines, ---------------------- wake up study hard play a little getting hungry <---- insert a line after this line watch TV go shopping come back home getting hungry <--- insert a line after this line listen music surf internet go to... (2 Replies)
Discussion started by: uday610
2 Replies

4. UNIX for Advanced & Expert Users

Inserting a line before the line which matches the patter

Hi Is there any command where we can insert a line "2|||" before every line starting with "3|" my input is as follows 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 3|79.58|||GBP|| 1|ETG|12345 2|EN_GB||Electrogalvanize 0.5 m2 ( Renault ) 1|ETG|12345 3|88.51|||GBP|| desired output... (10 Replies)
Discussion started by: laxmi131
10 Replies

5. Shell Programming and Scripting

inserting line to a file

I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well. Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line. File: red blue green ABC.txt@ABC END black... (1 Reply)
Discussion started by: ngupta
1 Replies

6. Shell Programming and Scripting

Inserting a line at the end

Hi All, I am using the below script to enter the URL at the end of file: echo "Enter the URL that should point to the particular microsite" read url sed "$a $url" redirects.virgin-atlantic.com.conf > temp But am getting the below error: ./script.sh:... (7 Replies)
Discussion started by: Shazin
7 Replies

7. Shell Programming and Scripting

Inserting a line in a file after every alternate line

Friends , I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated. My File control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1 control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Discussion started by: appu2176
4 Replies

8. Shell Programming and Scripting

Needed a help in inserting a new line!!!

Hi..wanted a help regarding inserting a newline in an xml file using shell script. i've an xml file which has the following data. 1. <?xml version="1.0" encoding="UTF-8"?> 2. <group> 3. <name>odcm</name> 4. contd.... I need to insert two new lines after line#2, so that the output... (14 Replies)
Discussion started by: arjun_arippa
14 Replies

9. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

10. UNIX for Dummies Questions & Answers

Inserting new line

Hi all, I want ot print a header with new line in the end. I am using echo like echo "this is header" I want output like This is header $ I tried -e also but it's not working. echo - e Can anyone help please? (6 Replies)
Discussion started by: dsa
6 Replies
DH_INSTALLDEB(1)						     Debhelper							  DH_INSTALLDEB(1)

NAME
dh_installdeb - install files into the DEBIAN directory SYNOPSIS
dh_installdeb [debhelperoptions] DESCRIPTION
dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directories in package build directories with the correct permissions. FILES
package.postinst package.preinst package.postrm package.prerm These maintainer scripts are installed into the DEBIAN directory. Inside the scripts, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. package.triggers package.shlibs These control files are installed into the DEBIAN directory. Note that package.shlibs is only installed in compat level 9 and earlier. In compat 10, please use dh_makeshlibs(1). package.conffiles This control file will be installed into the DEBIAN directory. In v3 compatibility mode and higher, all files in the etc/ directory in a package will automatically be flagged as conffiles by this program, so there is no need to list them manually here. package.maintscript Lines in this file correspond to dpkg-maintscript-helper(1) commands and parameters. However, the "maint-script-parameters" should not be included as debhelper will add those automatically. Example: # Correct rm_conffile /etc/obsolete.conf 0.2~ foo # INCORRECT rm_conffile /etc/obsolete.conf 0.2~ foo -- "$@" In compat 10 or later, any shell metacharacters will be escaped, so arbitrary shell code cannot be inserted here. For example, a line such as "mv_conffile /etc/oldconffile /etc/newconffile" will insert maintainer script snippets into all maintainer scripts sufficient to move that conffile. It was also the intention to escape shell metacharacters in previous compat levels. However, it did not work properly and as such it was possible to embed arbitrary shell code in earlier compat levels. The dh_installdeb tool will do some basic validation of some of the commands listed in this file to catch common mistakes. The validation is enabled as a warning since compat 10 and as a hard error in compat 12. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLDEB(1)
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy