| www.delorie.com/gnu/docs/sed/sed_19.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This one begins a series of totally useless (yet interesting)
scripts emulating various Unix commands. This, in particular,
is a tac workalike.
Note that on implementations other than GNU sed
this script might easily overflow internal buffers.
#!/usr/bin/sed -nf # reverse all lines of input, i.e. first line became last, ... # from the second line, the buffer (which contains all previous lines) # is *appended* to current line, so, the order will be reversed 1! G # on the last line we're done -- print everything $ p # store everything on the buffer again h |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |