[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
sourceForge/sedFAQ5
3. TECHNICAL 3.1. detailed explanation of basic sed 3.2. one-line scripts. How do I . . . ? - double/triple-space a file? - convert DOS/Unix newlines? - delete leading/trailing spaces? - do substitutions on all/certain lines? - delete consecutive blank lines? - delete blank lines at the top/end of the file? 3.3. Addressing and address ranges 3.6. Notes about s2p, the sed-to-perl translator 3.7. GNU/POSIX extensions to regular expressions 4. EXAMPLES 4.1. perform a case-insensitive search? 4.2. make changes in only part of a file? 4.3. change only the first occurrence of a pattern? 4.4. make substitutions in every file in a directory, or in a complete directory tree? 4.4.1 - Perl solution , 4.4.2 - Unix solution , 4.4.3 - DOS solution 4.5. parse a comma-delimited data file 4.6. insert a newline into the RHS of a substitution 4.7. represent control-codes or non-printable characters 4.8. read environment variables 4.8.1. - on Unix platforms 4.8.2. - on MS-DOS or 4DOS platforms 4.9. export or pass variables back into the environment 4.9.1. - on Unix platforms 4.9.2. - on MS-DOS or 4DOS platforms 4.10. handling shell quoting 4.11. delete a block of text if the block contains a certain regular expression 4.12. locate/print a paragraph of text if the paragraph contains a certain regular expression 4.13. delete a block of _specific_ consecutive lines 4.14. read (insert/add) a file at the top of a textfile 4.15. address all the lines between RE1 and RE2, excluding the lines themselves 4.16. replace "/some/UNIX/path" in a substitution 4.17. replace "C:\SOME\DOS\PATH" in a substitution 4.18. convert files with toggle characters, like +this+, to look like [i]this[/i] 4.19. delete only the first occurrence of a pattern 4.20. commify a string of numbers |
5. WHY ISN'T THIS WORKING? 5.1. Why don't variables like $var get expanded in scripts? 5.2. using 'p' to print produces duplicate lines sometimes. 5.3. DOS version quit prematurely? 5.4. RE isn't matching/deleting as expected. (Or, "Greedy vs. stingy pattern matching") 5.5. What is CSDPMI*B.ZIP ? 5.6. Where are the man pages for GNU? 5.7. Displaying version 5.8. exit code 5.9. The 'r' command isn't inserting the file into the text. 5.10. matching or deleteing a newline using the \n escape sequence? Matching 2 or more lines using \n? 5.11. aborts with an error message, "event not found". 6. OTHER ISSUES 6.1. Where can I get help? 6.2. compare with awk, perl, and other utilities? 6.3. When to use sed? 6.4. & when NOT? 6.5. use Awk or Perl instead? 6.6. limitations 6.7. bugs 6.8. incompatibilities between versions 6.8.1. Issuing commands from the command line 6.8.2. Using comments (prefixed by the '#' sign) 6.8.3. Special syntax in REs 6.8.4. Word boundaries 6.8.5. Range addressing with GNU sed and HHsed 6.8.6. Commands which operate differently | |