| Quick links: DOWNLOAD | CHANGELOG |
Page contents:
| The Quick Sample |
|---|
![]() |
-d option turns debug ON
--hide=hold options hides the HOLD SPACE buffer contents,
because it is always empty on this example.
PATT: lines on sedsed's output shows the PATTERN SPACE buffer
contents
COMM: yellow lines show the command which is being executed
user and otheruser lines are the SED's normal output
$ sign at the end of PATT: lines represent the end of the
buffer
| The Indent Sample |
|---|
![]() |
-f option reads the SED script from a file (just like in SED)
--indent option reformats complicated SED scripts into
beautiful human-friendly scripts
| The Debug Sample |
|---|
![]() |
-d option turns debug ON
HOLD: lines shows the HOLD SPACE buffer contents
x command
\n that is inserted in PATTERN SPACE between the two lines
joined by the G command
Besides indent and debug, sedsed also has the ability to convert your
SED scripts to nice HTML pages, with the syntax highlighted just as in
Vim Editor, with nice colors! To HTMLize the previous
email-linker.sed script, we do:
prompt$ sedsed --htmlize -f email-linker.sed > email-linker.sed.html
Just download this file: sedsed-1.0
Note 1: The Python interpreter is installed by default on Linux and MacOS X systems. If you are on Windows or other systems, check if you have it installed. If not, you can download it from www.python.org/download/, it is quick and safe.
See the friendly help screen with all the available options and try it on your own SED scripts!
prompt$ sedsed --help
usage: sedsed OPTION [-e sedscript] [-f sedscriptfile] [inputfile]
OPTIONS:
-f, --file add file contents to the commands to be parsed
-e, --expression add the script to the commands to be parsed
-n, --quiet suppress automatic printing of pattern space
--silent alias to --quiet
-d, --debug debug the sed script
--hide hide some debug info (options: PATT,HOLD,COMM)
--color shows debug output in colors (default: ON)
--nocolor no colors on debug output
--dump-debug dumps to screen the debugged sed script
--emu emulates GNU sed (INCOMPLETE)
--emudebug emulates GNU sed debugging the sed script (INCOMPLETE)
-i, --indent script beautifier, prints indented and
one-command-per-line output do STDOUT
--prefix indent prefix string (default: 4 spaces)
-t, --tokenize script tokenizer, prints extensive
command by command information
-H, --htmlize converts sed script to a colorful HTML page
Sedsed was tested successfuly against all the 5 stars (*****) extreme
SED scripts from the
Bonzini's excellent grab-bag site.
So all the sed commands and structures wrote on these scripts, which
are EXTREME, are correctly parsed.
If you want to try at home, download them from the grab-bag's site and execute this way:
echo -e "one\ntwo\nthree\nfour" | sedsed -d -f sodelnum.sed
echo -e "one\ntwo\nthree\nfour" | sedsed -d -f sort.sed
echo a{b{c{bla}}} | sedsed -d -f tex2xml.sed
echo "aa='abc" | sedsed -d -f config.sed
(date +'%w %d' ; date +'%-m %Y') | sedsed -d -f cal.sed
And now, calm down, close your eyes, deep breath: DC.SED!!!
echo 4 4 + p | sedsed -d -f dc.sed
Don't believe? See it for yourself!
.
Version 1.0, released on 2004-12-09
From 0.8 to 1.0?
This release should be 0.9 because the last one was 0.8, from one year ago. But there are so many nice changes, including performance gain and portability, that the program deserves a 1.0 version. One year is so much time, but the wait resulted in a quality jump in sedsed.
Debug Faster and Diet!
The debug action was the most changed. Now sedsed generates "diet" debug scripts, reducing around 40% of the file size* compared to the previous version. With less commands on the debug file and an important simplification on the debug commands, the debugged sed script now executes faster.
* In scripts that use the "t" command.
Works in Your Old Buggy SED
Other changes on the debug action aimed portability. The syntax of the debug commands now is very conservative. If the previous version of sedsed did not work in your old UNIX sed, try this one!
The full list of changes:
Older versions history:
echo p | sed -f - file
| Sedsed Output | |
|---|---|
PATT: |
Contents of the PATTERN SPACE buffer |
HOLD: |
Contents of the HOLD SPACE buffer |
COMM: |
The SED command being executed |
$ |
Terminates the PATT and HOLD contents |
... |
Lines that don't begin with any identifiers are STDOUT |
| Action Options | |
--debug |
DEBUG the sed script |
--indent |
Script beautifier, show indented source |
--tokenize |
Script tokenizer, show info about each command |
--htmlize |
Converts sed script to a colorful HTML page |
| Tips | |
! |
less -r is your friend to page the colorful output of -d |
! |
Use the --hide option to a cleaner debug output |
! |
--htmlize send results to STDOUT, so redirect it |
Other Aurelio's Software at http://aurelio.net/soft
|
(see source) |