Sie sind hier:
Home
->
The SED FAQ
The SED FAQ
http://sed.sourceforge.net/sedfaq.html
1.
GENERAL INFORMATION
1.1
Introduction - How this FAQ is organized
1.2
Latest version of the sed FAQ
1.3
FAQ revision information
1.4
How do I add a question/answer to the sed FAQ?
1.5
FAQ abbreviations
1.6
Credits and acknowledgements
1.7
Standard disclaimers
2.
BASIC SED
2.1
What is sed?
2.2
What versions of sed are there, and where can I get them?
2.3
Where can I learn to use sed?
3.
TECHNICAL
3.1
More detailed explanation of basic sed
3.2
Common one-line sed scripts
3.3
Addressing and address ranges
3.4
Address ranges in GNU sed and HHsed
3.5
Debugging sed scripts
3.6
Notes about s2p, the sed-to-perl translator
3.7
GNU/POSIX extensions to regular expressions
4.
EXAMPLES - ONE-CHARACTER QUESTIONS
4.1
How do I insert a newline into the RHS of a substitution?
4.2
How do I represent control-codes or nonprintable characters?
4.3
How do I convert files with toggle characters, like +this+, to look like [i]this[/i]?
4.4
How do I perform a case-insensitive search?
4.5
How do I match only the first occurrence of a pattern?
4.6
How do I parse a comma-delimited (CSV) data file?
4.7
How do I handle fixed-length, columnar data?
4.8
How do I commify a string of numbers?
4.9
How do I prevent regex expansion on substitutions?
4.10
How do I convert a string to all lowercase or capital letters?
4.11
How do I replace "C:\SOME\DOS\PATH" in a substitution?
4.12
How do I convert files with toggle characters, like this, to look like [i]this[/i]?
4.13
How do I delete only the first occurrence of a pattern?
4.14
How do I change only one section of a file?
4.15
How do I delete or change a block of text if the block contains a certain regular expression?
4.16
How do I locate a paragraph of text if the paragraph contains a certain regular expression?
4.17
How do I match a block of _specific_ consecutive lines?
4.18
How do I address all the lines between RE1 and RE2, excluding the lines themselves?
4.19
How do I join two lines if line #1 ends in a [certain string]?
4.20
How do I join two lines if line #2 begins in a [certain string]?
4.21
How do I change all paragraphs to long lines?
4.22
How do I read environment variables with sed?
4.23
How do I export or pass variables back into the environment?
4.24
How do I handle Unix shell quoting in sed?
4.25
How do I read (insert/add) a file at the top of a textfile?
4.26
How do I make substitutions in every file in a directory, or in a complete directory tree?
4.27
How do I replace "/some/UNIX/path" in a substitution?
4.28
How do I replace "C:\SOME\DOS\PATH" in a substitution?
4.29
How do I emulate file-includes, using sed?
5.
WHY ISN'T THIS WORKING?
5.1
Why don't my variables like $var get expanded in my sed script?
5.2
I'm using 'p' to print, but I have duplicate lines sometimes.
5.3
Why does my DOS version of sed process a file part-way through and then quit?
5.4
My RE isn't matching/deleting what I want it to. (Or, "Greedy vs. stingy pattern matching")
5.5
What is CSDPMI*B.ZIP and why do I need it?
5.6
Where are the man pages for GNU sed?
5.7
How do I tell what version of sed I am using?
5.8
Does sed issue an exit code?
5.9
The 'r' command isn't inserting the file into the text.
5.10
Why can't I match or delete a newline using the \n escape sequence? Why can't I match 2 or more lines using \n?
5.11
My script aborts with an error message, "event not found".
6.
OTHER ISSUES
6.1
I have a certain problem that stumps me. Where can I get help?
6.2
How does sed compare with awk, perl, and other utilities?
6.3
When should I use sed?
6.4
When should I NOT use sed?
6.5
When should I ignore sed and use awk or Perl instead?
6.6
Known limitations among sed versions
6.7
Known incompatibilities between sed versions
7.
KNOWN BUGS AMONG SED VERSIONS
7.1
ssed v3.59 (by Paolo Bonzini)
7.2
GNU sed v4.0 - v4.0.5
7.3
GNU sed v3.02.80
7.4
GNU sed v3.02
7.5
GNU sed v2.05
7.6
GNU sed v1.18
7.7
GNU sed v1.03 (by Frank Whaley)
7.8
sed v1.6 (by Walter Briscoe) - still in beta version
7.9
HHsed v1.5 (by Howard Helman)
7.10
sedmod v1.0 (by Hern Chen)
7.11
HP-UX sed
7.12
SunOS sed v4.1
7.13
SunOS sed v5.6
7.14
Ultrix sed v4.3
7.15
Digital Unix sed
|
|
GENERAL INFORMATION