#!/bin/sh
echo Aktivne sed.HOWTO
echo Toto vymeni prvy riadok a do druheho prida
cat $1|sed -e '2i\
riadok2' -e '1c\
toto je prvy riadok'
echo tento by mal vytlacit nonprintable characters
cat $1|sed -n -e 'l'
echo Tento nahradi pismenka a retazcom bukvaA
cat $1 | sed -e 's/a/bukvaA/g'
echo Tento skonci po dvoch riadkoch
cat $1|sed -e '2q'
echo Tento zas prezmenu vytlaci len riadky obsahujuce a
cat $1|sed -n -e '/a/p'

Try this cool one
echo abcdefghi | sed -e 's/abc\(.*\)ghi/\1/'

or to get value from a config file
cat ~/.some.cfg |sed -n -e 's/username = \(.*\)/\1/p'