diff options
author | Christopher Faylor <me@cgf.cx> | 2010-03-27 05:26:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-03-27 05:26:51 +0000 |
commit | cf989df66aea7b7a6d50867f00d1d78103a64bee (patch) | |
tree | 9792a222d284c9c922f6b3d31ffd9090ace4baac /winsup/doc/textbinary.sgml | |
parent | 86a58929ba3820da7f14f508056a5540fd081425 (diff) | |
download | cygnal-cf989df66aea7b7a6d50867f00d1d78103a64bee.tar.gz cygnal-cf989df66aea7b7a6d50867f00d1d78103a64bee.tar.bz2 cygnal-cf989df66aea7b7a6d50867f00d1d78103a64bee.zip |
* textbinary.sgml: Remove tr example and just mention u2d and d2u instead.
Diffstat (limited to 'winsup/doc/textbinary.sgml')
-rw-r--r-- | winsup/doc/textbinary.sgml | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/winsup/doc/textbinary.sgml b/winsup/doc/textbinary.sgml index 055a5e012..bb49d411d 100644 --- a/winsup/doc/textbinary.sgml +++ b/winsup/doc/textbinary.sgml @@ -68,45 +68,14 @@ Non-Cygwin shells always pipe and redirect with binary mode. With non-Cygwin shells the commands <command> cat filename | program </command> and <command> program < filename </command> are not equivalent when <filename>filename</filename> is on a text-mounted partition. </para> +<para>The programs <command>u2d</command> and <command>d2u</command> can +be used to add or remove CR's from a file. <command>u2d</command> add's CR's before a NL. +<command>d2u</command> removes CR's. Use the --help option to these commands +for more information. </listitem> </orderedlist> </sect2> -<sect2 id="textbin-example"><title>Example</title> -<para>To illustrate the various rules, we provide scripts to delete CRs -from files by using the <command>tr</command> program, which can only write -to standard output. -The script</para> -<screen> -<![CDATA[ -#!/bin/sh -# Remove \r from the file given as argument -tr -d '\r' < "$1" > "$1".nocr -]]> -</screen> -<para> will not work on a text mounted systems because the \r will be -reintroduced on writing. However scripts such as </para> -<screen> -<![CDATA[ -#!/bin/sh -# Remove \r from the file given as argument -tr -d '\r' | gzip | gunzip > "$1".nocr -]]> -</screen> -<para>and the .bat file</para> -<screen> -<![CDATA[ -REM Remove \r from the file given as argument -@echo off -tr -d \r < %1 > %1.nocr -]]> -</screen> -<para> work fine. In the first case we rely on <command>gunzip</command> to -set its output to binary mode, possibly overriding the mode used by the shell. -In the second case we rely on the DOS shell to redirect in binary mode. -</para> -</sect2> - <sect2 id="textbin-question"><title>Binary or text?</title> <para>UNIX programs that have been written for maximum portability |