Sponsored Content
Top Forums Shell Programming and Scripting sed - append line after block Post 302796347 by zaxxon on Friday 19th of April 2013 09:40:26 AM
Old 04-19-2013
Quote:
@zaxxon: The problem with GNU-sed is that in some regards it works in outright contradiction to the POSIX-standard which most other sed-implementations adhere to.
@bakunin:
I know - that's why I asked the latter Smilie

Like bakunin wrote it as non-one-liner, sed on AIX for example needs to have nested parts with curled brackets on their own line.

That might be your problem here too.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using SED to append character to each line

Hey - my first post here, and I'm a total SED newb. I've looked around for previous help on this, but have so far been unsuccessful. I have a program (AMStracker for OS X) that outputs data in the terminal. Output is in this form: . . . 3 0 -75 3 0 -76 3 0 -77 ... (4 Replies)
Discussion started by: c0nn0r
4 Replies

2. UNIX for Dummies Questions & Answers

using sed to append text to the end of each line

Anyone know how to use SED to append a comma to the end of each line example: field1,field2,field3,field4 If i Cat /textfile ---- How can i append the end of /textfile with a comman? (8 Replies)
Discussion started by: Redg
8 Replies

3. Shell Programming and Scripting

Sed : identify a pattern and append a word at the end of a line

Hello to all, On aix, I want to identify a term on a line in a file and then add a word at the end of the line identified. I do not want the word to be added when the line contains the symbol "#". I use the following command, but it deletes the term identified then adds the word. #sed... (4 Replies)
Discussion started by: dantares
4 Replies

4. UNIX for Dummies Questions & Answers

sed - append text to every line

Hi all I tried this on an old version of sed on NCR Unix MP-RAS: sed -e "s/$/nnn/" file1 >file2 This file (file1): the cat sat on the mat. the cat sat on the mat. the cat sat on the mat. becomes this (file2): the cat sat on the mat.nnn the cat sat on the mat.nnn nnn the... (3 Replies)
Discussion started by: jgrogan
3 Replies

5. 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

6. 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

7. Shell Programming and Scripting

sed to append on specific line in password file

I have the a group file and my ftp group line looks like this ... (3 Replies)
Discussion started by: slufoot80
3 Replies

8. Shell Programming and Scripting

sed - Find a String and append a text end of the Line

Hi, I have a File, which have multiple rows. Like below 123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY 123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY 123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies

9. Shell Programming and Scripting

Using sed to find and append or insert on SAME line

Hi, $ cat f1 My name is Bruce and my surname is I want to use SED to find “Bruce” and then append “ Lee” to the end of the line in which “Bruce” is found Then a more tricky one…. I want to INSERT ….a string… in to a line in which I find sometihng. So example $ cat f2 My name is... (9 Replies)
Discussion started by: Imre
9 Replies

10. Shell Programming and Scripting

sed command to append word at end of line

hello Team, I am looking for sed command or script which will append word at end of line. for example. I want to validate particular filesystem with mount |<filesystem name> command. if nodev parameter is not there then it should add in the fstab file with receptive to the filesystem. # mount... (8 Replies)
Discussion started by: ghpradeep
8 Replies
inifile(n)						   Parsing of Windows INI files 						inifile(n)

__________________________________________________________________________________________________________________________________________________

NAME
inifile - Parsing of Windows INI files SYNOPSIS
package require Tcl 8.2 package require inifile ?0.2.3? ::ini::open file ?access? ::ini::close ini ::ini::commit ini ::ini::revert ini ::ini::filename ini ::ini::sections ini ::ini::keys ini section ::ini::get ini section ::ini::exists ini section ?key? ::ini::value ini section key ?default? ::ini::set ini section key value ::ini::delete ini section ?key? ::ini::comment ini section ?key? ?text? ::ini::commentchar ?char? _________________________________________________________________ DESCRIPTION
This package provides an interface for easy manipulation of Windows INI files. ::ini::open file ?access? Opens an INI file and returns a handle that is used by other commands. access is the same as the first form (non POSIX) of the open command, with the exception that mode a is not supported. The default mode is r+. ::ini::close ini Close the specified handle. If any changes were made and not written by commit they are lost. ::ini::commit ini Writes the file and all changes to disk. The sections are written in arbitrary order. The keys in a section are written in alphabet- ical order. If the ini was opened in read only mode an error will be thrown. ::ini::revert ini Rolls all changes made to the inifile object back to the last committed state. ::ini::filename ini Returns the name of the file the ini object is associated with. ::ini::sections ini Returns a list of all the names of the existing sections in the file handle specified. ::ini::keys ini section Returns a list of all they key names in the section and file specified. ::ini::get ini section Returns a list of key value pairs that exist in the section and file specified. ::ini::exists ini section ?key? Returns a boolean value indicating the existance of the specified section as a whole or the specified key within that section. ::ini::value ini section key ?default? Returns the value of the named key and section. If specified, the default value will be returned if the key does not exist. If the key does not exist and no default is specified an error will be thrown. ::ini::set ini section key value Sets the value of the key in the specified section. If the section does not exist then a new one is created. ::ini::delete ini section ?key? Removes the key or the entire section and all its keys. A section is not automatically deleted when it has no remaining keys. ::ini::comment ini section ?key? ?text? Reads and modifies comments for sections and keys. To write a section comment use an empty string for the key. To remove all com- ments use an empty string for text. text may consist of a list of lines or one single line. Any embedded newlines in text are prop- erly handled. Comments may be written to nonexistant sections or keys and will not return an error. Reading a comment from a nonex- istant section or key will return an empty string. ::ini::commentchar ?char? Reads and sets the comment character. Lines that begin with this character are treated as comments. When comments are written out each line is preceded by this character. The default is ;. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category inifile of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. CATEGORY
Text processing inifile 0.2.3 inifile(n)
All times are GMT -4. The time now is 05:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy