Seders\’s grab bag – Tutorials

2010-01-24 555 words 3 mins read

<a href="http://sed.sourceforge.net/grabbag/tutorials/">http://sed.sourceforge.net/grabbag/tutorials/

<span style="font-size: x-large;"><a href="http://sed.sourceforge.net/grabbag/">seder&#8217;s<a href="http://sed.sourceforge.net/grabbag/"> grab bag

  • <a href="http://sed.sourceforge.net/grabbag/scripts/">scripts

  • <a href="http://sed.sourceforge.net/grabbag/tutorials/">tutorials

  • <a href="http://sed.sourceforge.net/grabbag/seders/">seders

  • <a href="http://sed.sourceforge.net/grabbag/ssed/">ssed

  • <a href="http://sed.sourceforge.net/grabbag/links/">links

  • <a href="http://sed.sourceforge.net/grabbag/tutorials/#intros">Intros

  • <a href="http://sed.sourceforge.net/grabbag/tutorials/#advanced">Advanced

  • <a href="http://sed.sourceforge.net/grabbag/tutorials/#misc">Miscellaneous

<span style="font-size: large;">Sed Tutorials

If you have written anything about sed – whether an introduction, how sed got you out of a real-life situation, or perhaps an advanced technique you&#8217;ve discovered – you may like have your work published here. <a href="mailto:bonzini@gnu.org">Your contribution will be very welcome.

<span style="font-size: medium;">Intros

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sed1line.txt">sed one-liners (18kb)

The essential, official compendium of useful sed one-liners. Organised into sections by usage, such as file spacing, line numbering, selective line removal/deletion and optimisation.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sedfaq.txt">The sed FAQ v15 (168kb)

The official, indispensable sed FAQ. This file was recently updated. Also available as <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sedfaq.zip">ZIP-compressed HTML (75kb). The latest version can always be found on <a href="http://www.student.northpark.edu/pemente/sed/sedfaq.html">the author&#8217;s site.

<a href="http://www.dreamwvr.com/sed-info/sed-faq.html">Another sed FAQ

And here is another sed FAQ, by a different person.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/do_it_with_sed.txt">Do it with sed (51kb)

By <a href="mailto:cgd@teleweb.pt">Carlos Jorge G.Duarte. A comprehensive and leisurely résumé. Contains many interesting examples, and a useful command summary.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sed_mcmahon.txt">SED – A Non-interactive Text Editor (32kb)

By Lee E. McMahon (1978). The definitive introduction, this well-known document used to be distributed with UNIX systems. It examines each of sed&#8217;s functions in depth and includes useful examples.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sed_state.txt">Program state in sed (4kb)

By Greg Ubben. A nice introduction to advanced sed, showing how to mantain state across lines.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/sed_introduction.txt">Introduction to Unix&#8217;s SED editor

By F. Curtis Michel, Rice University, Houston.

<span style="font-size: medium;">Advanced topics

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/indexer.txt">Using sed to create a book index (12kb)

Eric Pement of Cornerstone magazine shows how he used sed and other utilities to massage an unsorted list of book references into an index.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/lookup_tables.txt">Using lookup tables with s/// (9kb)

Part 1 of Greg Ubben&#8217;s analysis of a complex sed script he wrote to sort, delimit and number an input file containing tabulated data. Lookup tables are a powerful technique for the serious seder&#8217;s armoury.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/lookup_table_counter.txt">A lookup-table counter (11kb)

Part 2 of Greg&#8217;s script analysis looks at how he implemented a counter using lookup tables. This complex problem is described step by step from the basics, following through Greg&#8217;s reasoning until we finally reach the solution.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/greg_wc.txt">Counting words (3kb)
<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/greg_add.txt">Adding a list of decimals (3kb)

Greg explains how to count words and how to add a list of decimal numbers using a simple analog format.

<span style="font-size: medium;">Miscellaneous

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/nasty_characters.txt">When seemingly obvious scripts fail (2kb)

sed FAQ author Eric Pement explains why sometimes you cannot get your one-liner right.

<a href="http://sed.sourceforge.net/grabbag/tutorials/hanoi.htm">Towers of Hanoi with <a href="http://sed.sourceforge.net/grabbag/tutorials/hanoi.htm">sed (18kb)

A document which shows how to make sed solve the classic Towers of Hanoi game.

<a href="http://sed.sourceforge.net/grabbag/tutorials/custom_sed.htm">Proposals for a custom sed (18kb)

A list of proposals to make sed more versatile without sacrificing its speed and overall philosophy. I implemented a few of these in <a href="http://sed.sourceforge.net/grabbag/ssed/">super-sed and in GNU sed 4.0. <h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.geeksaresexy.net/2009/08/24/happy-birthday-unix/">Happy Birthday, Unix! (geeksaresexy.net) <li class="zemanta-article-ul-li"><a href="http://www.macworld.com/article/142108/2009/08/smultrongone.html?lsrc=rss_main">The end of the road for a favored text editor (macworld.com) <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/08/22/turn-vim-or-emacs-into-and-ide-with-exuberant-ctags/">Turn Vim or Emacs Into and IDE With Exuberant-Ctags (slumpedoverkeyboarddead.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/86aac4a7-499d-4cfc-b63f-4e5dca76c396/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e4.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it