Sponsored Content
Top Forums Shell Programming and Scripting How to replace word with multiline text using shell scripting. Post 302695995 by Ganesh_more on Tuesday 4th of September 2012 06:27:03 AM
Old 09-04-2012
Hi puma i tried your code and it is working fine. I want to know in your code where have written the text to be written in the file should be on the next line coz i don't see anywhere '\n' ???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. Shell Programming and Scripting

Find and replace a part of the word in Shell

I have a csv file in which there are numbers like 078976/9XXX 098754/8XXX I want to replace the XXX with null. I want to know the command/code to do this. I know how to replace the whole word/number. But don't know how to replace a part of it. Thanks in advance, Mihir (3 Replies)
Discussion started by: mihirk
3 Replies

3. Shell Programming and Scripting

How to merge multiline into line begining with specific word

Hi, The file format is like the following. timestamp=2008-02-28-23.50.29.550675;category=CONTEXT;audit event=CONNECT; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.FA97.054468155029;application... (2 Replies)
Discussion started by: missyou
2 Replies

4. Shell Programming and Scripting

grep command to replace multiline text from httpd.conf file on Fedora

Hi, I am a newbie to shell scripting and to Linux environment as well. In my project I am trying to search for following text from the httpd.conf file <Directory '/somedir/someinnerdir'> AllowOverride All </Directory> and then remove this text and again rewrite the same text. The... (1 Reply)
Discussion started by: bhushan
1 Replies

5. Shell Programming and Scripting

Sed scripting, match text within line and replace

New to sed... Have a file foo.txt (below). Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique). So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line. What I have thus far: sed -e... (6 Replies)
Discussion started by: boolean2222
6 Replies

6. Homework & Coursework Questions

[Scripting]Find & replace using user input then replacing text after

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: (o) Checkout an auto part: should prompt the user for the name of the auto part and borrower's name: Name:... (2 Replies)
Discussion started by: SlapnutsGT
2 Replies

7. Shell Programming and Scripting

How to put a word starting at particular position in a file using shell scripting

Hi all, I'm new to shell scripting and hence this query. I have 2 files. temp.txt and config.txt. The values in temp.txt are tab separated. ex: temp.txt AB CDE GHIJ OPQRS WXY ex:config.txt (1st line for 1st element of temp.txt and so on) start = '1' end='5' start = '6' end =... (26 Replies)
Discussion started by: subhrap.das
26 Replies

8. Shell Programming and Scripting

perl : replace multiline text between two marker points

Hi there I just wondered if someone could give me some perl advice I have a bunch of text files used for a wiki that have common headings such as ---++ Title blah ---++ Summary blah ---++ Details Here is the multiline block of text I wish to (6 Replies)
Discussion started by: rethink
6 Replies

9. Shell Programming and Scripting

Shell scripting: frequency of specific word in a string and statistics

Hello friends, I need a BIG help from UNIX collective intelligence: I have a CSV file like this: VALUE,TIMESTAMP,TEXT 1,Sun May 05 16:13:05 +0000 2013,"RT @gracecheree: Praying God sends me a really great man one day. Gotta trust in his timing. 0,Sun May 05 16:13:05 +0000 2013,@sendi__... (19 Replies)
Discussion started by: kraterions
19 Replies

10. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
DEBCOMMIT(1)															      DEBCOMMIT(1)

NAME
debcommit - commit changes to a package SYNOPSIS
debcommit [--release] [--release-use-changelog] [--message=text] [--noact] [--diff] [--confirm] [--edit] [--changelog=path] [--all | files to commit] DESCRIPTION
debcommit generates a commit message based on new text in debian/changelog, and commits the change to a package's repository. It must be run in a working copy for the package. Supported version control systems are: cvs, git, hg (mercurial), svk, svn (Subversion), baz, bzr, tla (arch), darcs. OPTIONS
-c, --changelog path Specify an alternate location for the changelog. By default debian/changelog is used. -r, --release Commit a release of the package. The version number is determined from debian/changelog, and is used to tag the package in the repository. Note that svn/svk tagging conventions vary, so debcommit uses svnpath(1) to determine where the tag should be placed in the repository. -R, --release-use-changelog When used in conjunction with --release, if there are uncommited changes to the changelog then derive the commit message from those changes rather than using the default message. -m text, --message text Specify a commit message to use. Useful if the program cannot determine a commit message on its own based on debian/changelog, or if you want to override the default message. -n, --noact Do not actually do anything, but do print the commands that would be run. -d, --diff Instead of committing, do print the diff of what would have been committed if this option were not given. A typical usage scenario of this option is the generation of patches against the current working copy (e.g. when you don't have commit access right). -C, --confirm Display the generated commit message and ask for confirmation before committing it. It is also possible to edit the message at this stage; in this case, the confirmation prompt will be re-displayed after the editing has been performed. -e, --edit Edit the generated commit message in your favorite editor before committing it. -a, --all Commit all files. This is the default operation when using a VCS other than git. files to commit Specify which files to commit (debian/changelog is added to the list automatically.) -s, --strip-message, --no-strip-message If this option is set and the commit message has been derived from the changelog, the characters "* " will be stripped from the beginning of the message. This option is set by default and ignored if more than one line of the message begins with "[*+-] ". --sign-tags, --no-sign-tags If this option is set, then tags that debcommit creates will be signed using gnupg. Currently this is only supported by git. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variables are: DEBCOMMIT_STRIP_MESSAGE If this is set to no, then it is the same as the --no-strip-message command line parameter being used. The default is yes. DEBCOMMIT_SIGN_TAGS If this is set to yes, then it is the same as the --sign-tags command line parameter being used. The default is no. DEBCOMMIT_RELEASE_USE_CHANGELOG If this is set to yes, then it is the same as the --release-use-changelog command line parameter being used. The default is no. DEBSIGN_KEYID This is the key id used for signing tags. If not set, a default will be chosen by the revision control system. VCS SPECIFIC FEATURES
tla / baz If the commit message contains more than 72 characters, a summary will be created containing as many full words from the message as will fit within 72 characters, followed by an ellipsis. Each of the features described below is applicable only if the commit message has been automatically determined from the changelog. git If only a single change is detected in the changelog, debcommit will unfold it to a single line and behave as if --strip-message was used. Otherwise, the first change will be unfolded and stripped to form a summary line and a commit message formed using the summary line followed by a blank line and the changes as extracted from the changelog. debcommit will then spawn an editor so that the message may be fine-tuned before committing. hg / darcs The first change detected in the changelog will be unfolded to form a single line summary. If multiple changes were detected then an editor will be spawned to allow the message to be fine-tuned. bzr If the changelog entry used for the commit message closes any bugs then --fixes options to "bzr commit" will be generated to associate the revision and the bugs. LICENSE
This code is copyright by Joey Hess <joeyh@debian.org>, all rights reserved. This program comes with ABSOLUTELY NO WARRANTY. You are free to redistribute this code under the terms of the GNU General Public License, version 2 or later. AUTHOR
Joey Hess <joeyh@debian.org> SEE ALSO
svnpath(1). Debian Utilities 2013-12-23 DEBCOMMIT(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy