old-www/LDP/LDP-Author-Guide/html/commandprompt.html

401 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Command Prompts</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="LDP Author Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="DocBook: Sample Markup"
HREF="using-docbook.html"><LINK
REL="PREVIOUS"
TITLE="section and sectN: what's the difference?"
HREF="section.html"><LINK
REL="NEXT"
TITLE="Encoding Indexes"
HREF="encoding-index.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>LDP Author Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="section.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Appendix D. DocBook: Sample Markup</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="encoding-index.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="commandprompt"
></A
>D.3. Command Prompts</H1
><P
>&#13; There are likely as many ways of doing this as there are DocBook
authors; however, here are two ways that you might find useful.
Thanks to <A
HREF="http://www.appaji.net/"
TARGET="_top"
>Y Giridhar Appaji Nag</A
>
and
<A
HREF="http://linux-ip.net/"
TARGET="_top"
>Martin Brown</A
>
for the markup used here.
</P
><DIV
CLASS="example"
><A
NAME="ex-programlisting"
></A
><P
><B
>Example D-1. Command Prompt with <TT
CLASS="sgmltag"
>programlisting</TT
></B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;<TT
CLASS="sgmltag"
>&#60;programlisting&#62;</TT
>
<TT
CLASS="sgmltag"
>&#60;prompt&#62;</TT
># <TT
CLASS="sgmltag"
>&#60;/prompt&#62;</TT
><TT
CLASS="sgmltag"
>&#60;userinput&#62;</TT
><TT
CLASS="sgmltag"
>&#60;command&#62;</TT
>cd<TT
CLASS="sgmltag"
>&#60;/command&#62;</TT
> /some/dir<TT
CLASS="sgmltag"
>&#60;/userinput&#62;</TT
>
<TT
CLASS="sgmltag"
>&#60;prompt&#62;</TT
># <TT
CLASS="sgmltag"
>&#60;/prompt&#62;</TT
><TT
CLASS="sgmltag"
>&#60;userinput&#62;</TT
><TT
CLASS="sgmltag"
>&#60;command&#62;</TT
>ls<TT
CLASS="sgmltag"
>&#60;/command&#62;</TT
> -l<TT
CLASS="sgmltag"
>&#60;/userinput&#62;</TT
>
<TT
CLASS="sgmltag"
>&#60;/programlisting&#62;</TT
>
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Displays as:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;<TT
CLASS="prompt"
># </TT
><TT
CLASS="userinput"
><B
><B
CLASS="command"
>cd</B
> /some/dir</B
></TT
>
<TT
CLASS="prompt"
># </TT
><TT
CLASS="userinput"
><B
><B
CLASS="command"
>ls</B
> -l</B
></TT
>
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="example"
><A
NAME="ex-screen"
></A
><P
><B
>Example D-2. Command Prompt with <TT
CLASS="sgmltag"
>screen</TT
></B
></P
><P
>&#13; First create a general entity in the internal subset at the very
beginning of your document. This entity will define a name for the
shortcut which you can use to display the full prompt at any point
in your document.
<TT
CLASS="literal"
>&#60;!ENTITY prompt "&#60;prompt&#62;[user@machine
~/dir]$&#60;/prompt&#62;"&#62;</TT
>
</P
><P
>&#13; For more information about entities, read <A
HREF="tools-entities.html"
>Section D.8</A
>.
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;<TT
CLASS="sgmltag"
>&#60;screen&#62;</TT
>
&#38;prompt; <TT
CLASS="sgmltag"
>&#60;userinput&#62;</TT
>cd /some/dir<TT
CLASS="sgmltag"
>&#60;/userinput&#62;</TT
>
&#38;prompt; <TT
CLASS="sgmltag"
>&#60;userinput&#62;</TT
>ls -l<TT
CLASS="sgmltag"
>&#60;/userinput&#62;</TT
> <TT
CLASS="sgmltag"
>&#60;/screen&#62;</TT
>
</PRE
></FONT
></TD
></TR
></TABLE
><P
>Displays as:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>
<TT
CLASS="prompt"
>[user@machine ~/dir]$ </TT
><TT
CLASS="userinput"
><B
>cd /some/dir</B
></TT
>
<TT
CLASS="prompt"
>[user@machine ~/dir]$ </TT
><TT
CLASS="userinput"
><B
>ls -l</B
></TT
>
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><P
>&#13; If you would like to add the output of your commands you can add
<TT
CLASS="sgmltag"
>&#60;computeroutput&#62;</TT
> text<TT
CLASS="sgmltag"
>&#60;/computeroutput&#62;</TT
> within the
<TT
CLASS="sgmltag"
>&#60;screen&#62;</TT
> or <TT
CLASS="sgmltag"
>&#60;programlisting&#62;</TT
>
as appropriate.
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="section.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="encoding-index.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><TT
CLASS="sgmltag"
>&#60;section&#62;</TT
> and <TT
CLASS="sgmltag"
>&#60;sectN&#62;</TT
>: what's the difference?</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="using-docbook.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Encoding Indexes</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>