Added dos2unix, unix2dos, and unrpm.c thanks to robotti@metconnect.com.
[oweals/busybox.git] / docs / busybox.sgml
index d590237bf10dd5d7cf622bef5cecef70d48a5fe2..e8a91fa05eab33d129da53e61d1e6da920582097 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [...]>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ ]>
 <book id="BusyBoxDocumentation">
  <bookinfo>
   <title>BusyBox - The Swiss Army Knife of Embedded Linux</title>
@@ -59,8 +59,8 @@
 
   <chapter id="Syntax">
      <title>How to use BusyBox</title>
-       <sect1 id="How to use BusyBox">
-           <title>Syntax</title
+       <sect1 id="How-to-use-BusyBox">
+           <title>Syntax</title>
 
            <para>
            <screen>
@@ -75,7 +75,9 @@
            </para>
        </sect1>
 
-       <sect1 id="Invoking BusyBox">
+       <sect1 id="Invoking-BusyBox">
+           <title>Invoking BusyBox</title>
+
            <para>
            When you create a link to BusyBox for the function you wish to use, when
            BusyBox is called using that link it will behave as if the command itself
 
        </sect1>
 
-       <sect1 id="Common options">
+       <sect1 id="Common-options">
+           <title>Common options</title>
+
            <para>
            Most BusyBox commands support the <emphasis>--help</emphasis> option to provide 
            a terse runtime description of their behavior. 
 
   <chapter id="Commands">
      <title>BusyBox Commands</title>
-       <sect1 id="Available BusyBox Commands">
+       <sect1 id="Available-BusyBox-Commands">
            <title>Available BusyBox Commands</title>
                <para>
                Currently defined functions include:
                </para>
        </sect1>
 
+       <sect1 id="dos2unix">
+           <title>dos2unix</title>
+
+               <para>
+               Usage: dos2unix < dosfile > unixfile
+               </para>
+
+               <para>
+               Converts a text file from dos format to unix format.
+               </para>
+
+       </sect1>
+
        <sect1 id="du">
            <title>du</title>
 
                <para>
                Prints out a binary keyboard translation table to standard input.
                </para>
+
+               <para>
+               Example:
+               </para>
+
+               <para>
+               <screen>
+                       $ dumpkmap &lt; keymap
+               </screen>
+               </para>
        </sect1>
 
        <sect1 id="dutmp">
                </para>
        </sect1>
 
+       <sect1 id="expr">
+           <title>expr</title>
+
+               <para>
+               Usage: expr EXPRESSION
+               </para>
+
+               <para>
+               Prints the value of EXPRESSION to standard output.
+               </para>
+
+               <para>
+               EXPRESSION may be:
+               </para>
+
+               <para>
+               <screen>
+                       ARG1 |  ARG2    ARG1 if it is neither null nor 0, otherwise ARG2
+                       ARG1 &  ARG2    ARG1 if neither argument is null or 0, otherwise 0
+                       ARG1 &lt  ARG2    ARG1 is less than ARG2
+                       ARG1 &lt= ARG2    ARG1 is less than or equal to ARG2
+                       ARG1 =  ARG2    ARG1 is equal to ARG2
+                       ARG1 != ARG2    ARG1 is unequal to ARG2
+                       ARG1 &gt= ARG2    ARG1 is greater than or equal to ARG2
+                       ARG1 &gt  ARG2    ARG1 is greater than ARG2
+                       ARG1 +  ARG2    arithmetic sum of ARG1 and ARG2
+                       ARG1 -  ARG2    arithmetic difference of ARG1 and ARG2
+                       ARG1 *  ARG2    arithmetic product of ARG1 and ARG2
+                       ARG1 /  ARG2    arithmetic quotient of ARG1 divided by ARG2
+                       ARG1 %  ARG2    arithmetic remainder of ARG1 divided by ARG2
+                       STRING : REGEXP             anchored pattern match of REGEXP in STRING
+                       match STRING REGEXP         same as STRING : REGEXP
+                       substr STRING POS LENGTH    substring of STRING, POS counted from 1
+                       index STRING CHARS          index in STRING where any CHARS is found, or 0
+                       length STRING               length of STRING
+                       quote TOKEN                 interpret TOKEN as a string, even if it is a
+                                                       keyword like `match' or an operator like `/'
+                       ( EXPRESSION )              value of EXPRESSION
+               </screen>
+               </para>
+
+               <para>
+               Beware that many operators need to be escaped or quoted for shells.
+               Comparisons are arithmetic if both ARGs are numbers, else
+               lexicographical.  Pattern matches return the string matched between
+               \( and \) or null; if \( and \) are not used, they return the number
+               of characters matched or 0.
+               </para>
+
+       </sect1>
+
+
        <sect1 id="false">
            <title>false</title>
 
                </para>
        </sect1>
 
-<      <sect1 id="gzip">
+       <sect1 id="gzip">
            <title>gzip</title>
 
                <para>
                <screen>
                        &lt;id&gt;:&lt;runlevels&gt;:&lt;action&gt;:&lt;process&gt;
                </screen>
-               <para>
+               </para>
 
                <sect2>
                    <title>id</title>
                        </para>
                </sect2>
 
-               <para>
-               Example /etc/inittab file:
-               </para>
+               <sect2>
+                   <title>Example /etc/inittab file</title>
 
                <para>
                <screen>
                        # /bin/sh invocations on selected ttys
                        #
                        # Start an "askfirst" shell on the console (whatever that may be)
-                       ::askfirst:/bin/sh
-                       # Start an "askfirst" shell on /dev/tty2
-                       tty2::askfirst:/bin/sh
+                       ::askfirst:-/bin/sh
+                       # Start an "askfirst" shell on /dev/tty2-4
+                       tty2::askfirst:-/bin/sh
+                       tty2::askfirst:-/bin/sh
+                       tty2::askfirst:-/bin/sh
 
                        # /sbin/getty invocations for selected ttys
                        #
-                       tty4::respawn:/sbin/getty 38400 tty4
-                       tty5::respawn:/sbin/getty 38400 tty5
+                       tty4::respawn:/sbin/getty 38400 tty5
+                       tty5::respawn:/sbin/getty 38400 tty6
 
                        # Example of how to put a getty on a serial line (for a terminal)
                        #
                        #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
 
                        # Stuff to do before rebooting
-                       ::ctrlaltdel:/bin/umount -a -r &gt; /dev/null 2&gt;&amp;1
-                       ::ctrlaltdel:/sbin/swapoff -a &gt; /dev/null 2&gt;&amp;1
+                       ::ctrlaltdel:/bin/umount -a -r
+                       ::ctrlaltdel:/sbin/swapoff
                </screen>
                </para>
+               </sect2>
        </sect1>
 
        <sect1 id="insmod">
                </para>
 
                <para>
-               <screen>
                   or: [ EXPRESSION ]
+               </para>
 
                <para>
                Check file types and compare values returning an exit
                </screen>
                </para>
        </sect1>
+       
+       <sect1 id="unix2dos">
+           <title>unix2dos</title>
+
+               <para>
+               Usage: unix2dos < unixfile > dosfile
+               </para>
+
+               <para>
+               Converts a text file from unix format to dos format.
+               </para>
+
+       </sect1>
+
+       <sect1 id="unrpm">
+           <titleunrpmuniq</title>
+
+               <para>
+               Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
+               </para>
+
+               <para>
+               Extracts an rpm archive.
+               </para>
+
+       </sect1>
 
        <sect1 id="update">
            <title>update</title>
        Linus Torvalds &lt;torvalds@transmeta.com&gt;
        </para>
 
+        <para>
+        Mark Whitley &lt;markw@lineo.com&gt;
+        </para>
+
        <para>
        Charles P. Wright &lt;cpwright@villagenet.com&gt;
        </para>