Mail Archives: djgpp/2004/08/13/15:27:54
This is a port of GNU Sed 4.1.1 to MSDOS/DJGPP.
sed is a stream editor. A stream editor is used to perform basic text
transformations on an input stream (a file or input from a pipeline).
While in some ways similar to an editor which permits scripted edits
(such as ed), sed works by making only one pass over the input(s), and
is consequently more efficient. But it is sed's ability to filter text
in a pipeline which particularly distinguishes it from other types of
editors.
Please, read carefully the NEWS file to see the user visible changes
and read the info or html docs to become familiar with the program.
For beginers the chapter: examples in the info doc may be instructive.
The chapter: Other resources for learning about 'sed' contains pointers
to usefull sed specific urls.
DJGPP specific changes.
=======================
- The input stream is switched to binary mode, if it does not come from the
console, on platforms, like DOS/WIN95, that distinguish between text and
binary files. This will allow to process files that contain embedded ^Z
and lone ^M characters.
- If you have no DJGPP port of Sed installed and you want to rebuild this
package from sources, please read Eli Zaretskii's readme file called:
README.ORIG located in the djgpp directory. This explicitely explains
how to build the binary from the source package if no sed executable
is installed.
As usual, all djgpp specific files (config.bat, diffs, readme files, etc.)
are located in the djgpp subdir.
Here is an extract of the NEWS file showing the user visible changes from
the last port to this one:
Sed 4.1.1
* preserve permissions of in-place edited files
* yield an error when running -i on terminals or other non regular files
* do not interpret - as stdin when running in in-place editing mode
* fix bug that prevented 's' command modifiers from working
----------------------------------------------------------------------------
Sed 4.1
* // matches the last regular expression even in POSIXLY_CORRECT mode.
* change the way we treat lines which are not terminated by a newline.
Such lines are printed without the terminating newline (as before)
but as soon as more text is sent to the same output stream, the
missing newline is printed, so that the two lines don't concatenate.
The behavior is now independent from POSIXLY_CORRECT because POSIX
actually has undefined behavior in this case, and the new implementation
arguably gives the ``least expected surprise''. Thanks to Stepan
Kasal for the implementation.
* documentation improvements, with updated references to the POSIX.2
specification
* error messages on I/O errors are better, and -i does not leave temporary
files around (e.g. when running ``sed -i'' on a directory).
* escapes are accepted in the y command (for example: y/o/\n/ transforms
o's into newlines)
* -i option tries to set the owner and group to the same as the input file
* `L' command is deprecated and will be removed in sed 4.2.
* line number addresses are processed differently -- this is supposedly
conformant to POSIX and surely more idiot-proof. Line number addresses
are not affected by jumping around them: they are activated and
deactivated exactly where the script says, while previously
5,8b
1,5d
would actually delete lines 1,2,3,4 and 9 (!).
* multibyte characters are taken in consideration to compute the
operands of s and y, provided you set LC_CTYPE correctly. They are
also considered by \l, \L, \u, \U, \E.
* [\n] matches either backslash or 'n' when POSIXLY_CORRECT.
* new option --posix, disables all GNU extensions. POSIXLY_CORRECT only
disables GNU extensions that violate the POSIX standard.
* options -h and -V are not supported anymore, use --help and --version.
* removed documentation for \s and \S which worked incorrectly
* restored correct behavior for \w and \W: match [[:alnum:]_] and
[^[:alnum:]_] (they used to match [[:alpha:]_] and [^[:alpha:]_]
* the special address 0 can only be used in 0,/RE/ or 0~STEP addresses;
other cases give an error (you are hindering portability for no reason
if specifying 0,N and you are giving a dead command if specifying 0
alone).
* when a \ is used to escape the character that would terminate an operand
of the s or y commands, the backslash is removed before the regex is
compiled. This is left undefined by POSIX; this behavior makes `s+x\+++g'
remove occurrences of `x+', consistently with `s/x\///g'. (However, if
you enjoy yourself trying `s*x\***g', sed will use the `x*' regex, and you
won't be able to pass down `x\*' while using * as the delimiter; ideas on
how to simplify the parser in this respect, and/or gain more coherent
semantics, are welcome).
----------------------------------------------------------------------------
The port consists of the usual three packages that can be downloaded from
ftp.delorie.com and mirrors as (timestamp 2004-08-13):
Sed 4.1.1 binary, info and man format documentation:
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/sed411b.zip
Sed 4.1.1 dvi, html and ps format documentation:
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/sed411d.zip
Sed 4.1.1 source:
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/sed411s.zip
Send Sed specific bug reports to <bonzini AT gnu DOT org>.
Send suggestions and bug reports concerning the DJGPP port
to comp.os.msdos.djgpp or <djgpp AT delorie DOT com>.
Enjoy.
Guerrero, Juan Manuel <st001906 AT hrz1 DOT hrz DOT tu-darmstadt DOT de>
- Raw text -