Sponsored Content
Full Discussion: How to append using sed
Top Forums Shell Programming and Scripting How to append using sed Post 302346894 by asirohi on Monday 24th of August 2009 10:39:51 AM
Old 08-24-2009
Thanks, that worked
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

append to fle using sed

Hello , I have the folloiwing command : sed -n "$var,$final w $destfile" $sourcefile where : $var - $final represent the range of line numbers to be written in $destfile However I require this command to work in a loop for which i need the sed command to keep appending the output to the... (2 Replies)
Discussion started by: shweta_d
2 Replies

2. UNIX for Dummies Questions & Answers

Sed: Append and Delete?

I think it should be obvious what I'm trying to do from my command, but just to be sure it's clear, I'm trying to append 2 lines after a matched line and then delete 2 other lines within a file. I'd like to do it in 1 line if possible. This code isn't working, but hopefully it's just a syntax... (0 Replies)
Discussion started by: earnstaf
0 Replies

3. Shell Programming and Scripting

replace and append using SED

Hi, i need to replace hyphen with underscore in a string and also append some text before it. e.g. if the string is 130707-abc-123.txt then it has to be made UB130707_abc_123.txt. Also, need help on how to do it on many strings exist in a file. I know it can be done by using sed but it... (4 Replies)
Discussion started by: prvnrk
4 Replies

4. Shell Programming and Scripting

Append lines with SED

I have the following data in a file and would like to append the lines inside each section 10, 20, 30, 40, etc... onto one line for each of the sections. Is it possible with SED to make this happen?? 10 00039393 DOCK: RECEIVE PART, TAG. D D ... (3 Replies)
Discussion started by: miklacic
3 Replies

5. Shell Programming and Scripting

sed append in first column

hi, anyone can give a sample command on sed. the text file date list belows; test.txt "a","bbb",123 "b","ccc",234 "c","eee",456 output i need to add these word "xxx" "xxx","a","bbb",123 "xxx","b","ccc",234 "xxx" ,"c","eee",456 thanks in advance, FSP (4 Replies)
Discussion started by: fspalero
4 Replies

6. Shell Programming and Scripting

Append using SED/AWK

Hi friends, I have a file with content SOME TEXT HERE I want to append the string GREAT to Line 1 of my file such that the file content should be GREAT SOME TEXT HERE I can do a cat for the string great and file >> newfile and then rename newfile name to file But this does not put... (5 Replies)
Discussion started by: dahlia84
5 Replies

7. Shell Programming and Scripting

sed append words

Hi all, I have a file like one two three for five six seven eight ..... Actually i need to append a label to the words that belong to the 2 column and get: one two_label three for five six_label seven eight .... I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies

8. Shell Programming and Scripting

How to append line with sed?

Input: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly Output should be: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly How can it be done with sed? (5 Replies)
Discussion started by: cola
5 Replies

9. Shell Programming and Scripting

sed append to string

I am trying to replace in multiple files every instance of text that begins with http and add hyperlink characters to it. I can get it to work with the following:sed -e "s/http*.*/<a href=\"&\">&<\/a>/g" * as long as the http text is at the end of the file. I need it to stop at the end of the... (2 Replies)
Discussion started by: numele
2 Replies

10. Shell Programming and Scripting

sed append without using new line

im trying to append to the end of the line using sed but I want to do it without creating a new line the text to which I want to append is all in capital letters. I want to do something like this: LINE]Foo but when I do this: //a\ ] Foo it prints foo on a new line: LINE ]Foo ... (11 Replies)
Discussion started by: mrjavoman
11 Replies
SHTOOL-SUBST.TMP(1)					      GNU Portable Shell Tool					       SHTOOL-SUBST.TMP(1)

NAME
shtool-subst - GNU shtool sed(1) substitution operations SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext] [-e|--exec cmd] [-f|--file cmd-file] [file] [file ...] DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files. OPTIONS
The following command line options are available. -v, --verbose Display some processing information. -t, --trace Enable the output of the essential shell commands which are executed. -n, --nop No operation mode. Actual execution of the essential shell commands which would be executed is suppressed. -w, --warning Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution operations resulted in no content change on all files. -q, --quiet Suppress warning on substitution operation resulting in no content change. -s, --stealth Stealth operation. Preserve timestamp on file. -i, --interactive Enter interactive mode where the user has to approve each operation. -b, --backup ext Preserve backup of original file using file name extension ext. Default is to overwrite the original file. -e, --exec cmd Specify sed(1) command directly. -f, --file cmd-file Read sed(1) command from file. EXAMPLE
# shell script shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch] # RPM spec-file %install shtool subst -v -n -e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g' -e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g' `find . -name Makefile -print` make install HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications. SEE ALSO
shtool(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy