Sed: Difference between revisions

From RoggeWiki
Jump to navigation Jump to search
(Created page with ' =====Sed Oneliners===== Change first occurence ape in each line to rock. sed 's/ape/rock/'')
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Under construction}}


=====Sed Oneliners=====
sed - A stream editor for filtering and transforming text.


Change first occurence ape in each line to rock.  
pattern procedure
 
===Synopsis===
sed [-n] [-e] [-f ''filename''] [input-file]
===Sed Oneliners===
Change first occurence ''ape'' in each line to ''rock''.  
  sed 's/ape/rock/'
  sed 's/ape/rock/'
Delete all lines starting from the line containing ''ape'' to the line containing ''rock''.
sed '/ape/,/rock/d'
===Links===
Sed - An Introduction and Tutorial by Bruce Barnett  [http://www.grymoire.com/Unix/Sed.html Grymoire]
[[Category:Unix]]

Latest revision as of 07:22, 23 April 2013

This article is under construction. Please do not rely on any information it contains.


sed - A stream editor for filtering and transforming text.

pattern procedure

Synopsis

sed [-n] [-e] [-f filename] [input-file]

Sed Oneliners

Change first occurence ape in each line to rock.

sed 's/ape/rock/'

Delete all lines starting from the line containing ape to the line containing rock.

sed '/ape/,/rock/d'

Links

Sed - An Introduction and Tutorial by Bruce Barnett Grymoire