old-www/LDP/intro-linux/html/x12249.html

2065 lines
29 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Differing features</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Introduction to Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="Shell Features"
HREF="app3.html"><LINK
REL="PREVIOUS"
TITLE="Common features"
HREF="x12120.html"><LINK
REL="NEXT"
TITLE="Glossary"
HREF="gloss.html"></HEAD
><BODY
CLASS="sect1"
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"
>Introduction to Linux: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x12120.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Appendix C. Shell Features</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="gloss.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN12249"
></A
>C.2. Differing features</H1
><P
>The table below shows major differences between the standard shell
(<B
CLASS="command"
>sh</B
>), Bourne Again SHell (<B
CLASS="command"
>bash</B
>), Korn shell
(<B
CLASS="command"
>ksh</B
>) and the C shell (<B
CLASS="command"
>csh</B
>).</P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Shell compatibility</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Since the Bourne Again SHell is a superset of <B
CLASS="command"
>sh</B
>, all
<B
CLASS="command"
>sh</B
> commands will also work in <B
CLASS="command"
>bash</B
> - but not
vice versa. <B
CLASS="command"
>bash</B
> has many more features of its own, and, as the
table below demonstrates, many features incorporated from other shells.</P
><P
>Since the Turbo C shell is a superset of <B
CLASS="command"
>csh</B
>, all
<B
CLASS="command"
>csh</B
> commands will work in <B
CLASS="command"
>tcsh</B
>, but not the
other way round.</P
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="table"
><A
NAME="AEN12267"
></A
><P
><B
>Table C-2. Differing Shell Features</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>sh</B
>
</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>bash</B
>
</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>ksh</B
>
</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>csh</B
>
</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>Meaning/Action</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>$</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>$</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>$</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>%</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Default user prompt</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62;|</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62;|</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62;!</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Force redirection</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62; <TT
CLASS="filename"
>file</TT
> 2&#62;&#38;1</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#38;&#62; <TT
CLASS="filename"
>file</TT
>
</B
> or <B
CLASS="command"
>&#62; <TT
CLASS="filename"
>file</TT
> 2&#62;&#38;1</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62; <TT
CLASS="filename"
>file</TT
> 2&#62;&#38;1</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#62;&#38; <TT
CLASS="filename"
>file</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Redirect stdout and stderr to <TT
CLASS="filename"
>file</TT
>
</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>{ }</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>{ }</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Expand elements in list</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>`command`</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>`command`</B
> or <B
CLASS="command"
>$(command)</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>$(command)</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>`command`</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Substitute output of enclosed <B
CLASS="command"
>command</B
>
</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$HOME</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$HOME</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$HOME</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$home</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Home directory</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>~</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>~</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>~</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Home directory symbol</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="filename"
>~+</TT
>, <TT
CLASS="filename"
>~-</TT
>, <B
CLASS="command"
>dirs</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="filename"
>~+</TT
>, <TT
CLASS="filename"
>~-</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="filename"
>=-</TT
>, <TT
CLASS="filename"
>=N</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Access directory stack</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#13; <TT
CLASS="varname"
>var</TT
>=value</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#13; <TT
CLASS="varname"
>VAR</TT
>=value</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>&#13; <TT
CLASS="varname"
>var</TT
>=value</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>set <TT
CLASS="varname"
>var</TT
>=value</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Variable assignment</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>export <TT
CLASS="varname"
>var</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>export <TT
CLASS="varname"
>VAR</TT
>=value</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>export <TT
CLASS="varname"
>var</TT
>=val</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>setenv <TT
CLASS="varname"
>var</TT
>
<TT
CLASS="parameter"
><I
>val</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Set environment variable</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>${nnnn}</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>${nn}</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>More than 9 arguments can be referenced</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>"<TT
CLASS="varname"
>$@</TT
>"</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>"<TT
CLASS="varname"
>$@</TT
>"</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>"<TT
CLASS="varname"
>$@</TT
>"</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>All arguments as separate words</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$#</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$#</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$#</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$#argv</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Number of arguments</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$?</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$?</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$?</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$status</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Exit status of the most recently executed command</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$!</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$!</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$!</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>PID of most recently backgrounded process</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$-</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$-</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <TT
CLASS="varname"
>$-</TT
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Current options</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>. <TT
CLASS="filename"
>file</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>source <TT
CLASS="filename"
>file</TT
>
</B
> or <B
CLASS="command"
>. <TT
CLASS="filename"
>file</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>. <TT
CLASS="filename"
>file</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>source <TT
CLASS="filename"
>file</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Read commands in file</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>alias x='y'</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>alias x=y</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>alias x y</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Name <B
CLASS="command"
>x</B
> stands for command <B
CLASS="command"
>y</B
>
</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>case</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>case</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>case</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>switch</B
> or <B
CLASS="command"
>case</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Choose alternatives</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>done</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>done</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>done</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>end</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>End a loop statement</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>esac</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>esac</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>esac</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>endsw</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>End <B
CLASS="command"
>case</B
> or <B
CLASS="command"
>switch</B
>
</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>exit <TT
CLASS="parameter"
><I
>n</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>exit <TT
CLASS="parameter"
><I
>n</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>exit <TT
CLASS="parameter"
><I
>n</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>exit <TT
CLASS="parameter"
><I
>(expr)</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Exit with a status</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>for</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>for</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>for</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>foreach</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Loop through variables</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>set <TT
CLASS="option"
>-f</TT
>
</B
>, <B
CLASS="command"
>set <TT
CLASS="option"
>-o nullglob|dotglob|nocaseglob|noglob</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>noglob</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Ignore substitution characters for filename generation</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>alias <TT
CLASS="option"
>-t</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hashstat</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Display hashed commands (tracked aliases)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash <TT
CLASS="parameter"
><I
>cmds</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash <TT
CLASS="parameter"
><I
>cmds</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>alias <TT
CLASS="option"
>-t</TT
>
<TT
CLASS="parameter"
><I
>cmds</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>rehash</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Remember command locations</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash <TT
CLASS="option"
>-r</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>hash <TT
CLASS="option"
>-r</TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>unhash</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Forget command locations</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>history</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>history</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>history</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>List previous commands</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="keycap"
>ArrowUp</B
>+<B
CLASS="keycap"
>Enter</B
> or <B
CLASS="command"
>!!</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>r</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>!!</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Redo previous command</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>!<TT
CLASS="parameter"
><I
>str</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>r <TT
CLASS="parameter"
><I
>str</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>!<TT
CLASS="parameter"
><I
>str</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Redo last command that starts with <SPAN
CLASS="QUOTE"
>"str"</SPAN
>
</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>!<TT
CLASS="parameter"
><I
>cmd</I
></TT
>:s/<TT
CLASS="parameter"
><I
>x</I
></TT
>/<TT
CLASS="parameter"
><I
>y</I
></TT
>/</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>r <TT
CLASS="parameter"
><I
>x</I
></TT
>=<TT
CLASS="parameter"
><I
>y</I
></TT
>
<TT
CLASS="parameter"
><I
>cmd</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>!<TT
CLASS="parameter"
><I
>cmd</I
></TT
>:s/<TT
CLASS="parameter"
><I
>x</I
></TT
>/<TT
CLASS="parameter"
><I
>y</I
></TT
>/</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Replace <SPAN
CLASS="QUOTE"
>"x"</SPAN
> with <SPAN
CLASS="QUOTE"
>"y"</SPAN
> in most recent command
starting with <SPAN
CLASS="QUOTE"
>"cmd"</SPAN
>, then execute.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>if [ <TT
CLASS="varname"
>$i</TT
> -eq <TT
CLASS="parameter"
><I
>5</I
></TT
> ]</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>if [ <TT
CLASS="varname"
>$i</TT
> -eq <TT
CLASS="parameter"
><I
>5</I
></TT
> ]</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>if ((<TT
CLASS="varname"
>i</TT
>==<TT
CLASS="parameter"
><I
>5</I
></TT
>))</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>if (<TT
CLASS="varname"
>$i</TT
>==<TT
CLASS="parameter"
><I
>5</I
></TT
>)</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Sample condition test</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>fi</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>fi</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>fi</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>endif</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>End <B
CLASS="command"
>if</B
> statement</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>ulimit</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>ulimit</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>ulimit</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>limit</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Set resource limits</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>pwd</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>pwd</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>pwd</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>dirs</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Print working directory</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>read</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>read</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>read</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>$&#60;</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Read from terminal</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>trap <TT
CLASS="parameter"
><I
>2</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>trap <TT
CLASS="parameter"
><I
>2</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>trap <TT
CLASS="parameter"
><I
>2</I
></TT
>
</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>onintr</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Ignore interrupts</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>unalias</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>unalias</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>unalias</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Remove aliases</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>until</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>until</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>until</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Begin <B
CLASS="command"
>until</B
> loop</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>while</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>while</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>while</B
>/<B
CLASS="command"
>do</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13; <B
CLASS="command"
>while</B
>
</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Begin <B
CLASS="command"
>while</B
> loop</TD
></TR
></TBODY
></TABLE
></DIV
><P
>The Bourne Again SHell has many more features not listed here. This table is just to
give you an idea of how this shell incorporates all useful ideas from other shells:
there are no blanks in the column for <B
CLASS="command"
>bash</B
>. More information on
features found only in Bash can be retrieved from the Bash info pages, in the
<SPAN
CLASS="QUOTE"
>"Bash Features"</SPAN
> section.</P
><P
>More information:</P
><P
>You should at least read one manual, being the manual of your shell. The preferred
choice would be <B
CLASS="command"
>info bash</B
>, <B
CLASS="command"
>bash</B
> being the GNU
shell and easiest for beginners. Print it out and take it home, study it whenever you
have 5 minutes.</P
><P
>See <A
HREF="app2.html"
>Appendix B</A
> if you are having difficulties to assimilate shell commands.</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="x12120.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="gloss.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Common features</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="app3.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Glossary</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>