old-www/LDP/Bash-Beginners-Guide/html/chap_09.html

348 lines
4.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Repetitive tasks</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Bash Guide for Beginners"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Exercises"
HREF="sect_08_04.html"><LINK
REL="NEXT"
TITLE="The for loop"
HREF="sect_09_01.html"></HEAD
><BODY
CLASS="chapter"
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"
>Bash Guide for Beginners</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sect_08_04.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sect_09_01.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="chap_09"
></A
>Chapter 9. Repetitive tasks</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>9.1. <A
HREF="sect_09_01.html"
>The for loop</A
></DT
><DD
><DL
><DT
>9.1.1. <A
HREF="sect_09_01.html#sect_09_01_01"
>How does it work?</A
></DT
><DT
>9.1.2. <A
HREF="sect_09_01.html#sect_09_01_02"
>Examples</A
></DT
></DL
></DD
><DT
>9.2. <A
HREF="sect_09_02.html"
>The while loop</A
></DT
><DD
><DL
><DT
>9.2.1. <A
HREF="sect_09_02.html#sect_09_02_01"
>What is it?</A
></DT
><DT
>9.2.2. <A
HREF="sect_09_02.html#sect_09_02_02"
>Examples</A
></DT
></DL
></DD
><DT
>9.3. <A
HREF="sect_09_03.html"
>The until loop</A
></DT
><DD
><DL
><DT
>9.3.1. <A
HREF="sect_09_03.html#sect_09_03_01"
>What is it?</A
></DT
><DT
>9.3.2. <A
HREF="sect_09_03.html#sect_09_03_02"
>Example</A
></DT
></DL
></DD
><DT
>9.4. <A
HREF="sect_09_04.html"
>I/O redirection and loops</A
></DT
><DD
><DL
><DT
>9.4.1. <A
HREF="sect_09_04.html#sect_09_04_01"
>Input redirection</A
></DT
><DT
>9.4.2. <A
HREF="sect_09_04.html#sect_09_04_02"
>Output redirection</A
></DT
></DL
></DD
><DT
>9.5. <A
HREF="sect_09_05.html"
>Break and continue</A
></DT
><DD
><DL
><DT
>9.5.1. <A
HREF="sect_09_05.html#sect_09_05_01"
>The break built-in</A
></DT
><DT
>9.5.2. <A
HREF="sect_09_05.html#sect_09_05_02"
>The continue built-in</A
></DT
><DT
>9.5.3. <A
HREF="sect_09_05.html#sect_09_05_03"
>Examples</A
></DT
></DL
></DD
><DT
>9.6. <A
HREF="sect_09_06.html"
>Making menus with the select built-in</A
></DT
><DD
><DL
><DT
>9.6.1. <A
HREF="sect_09_06.html#sect_09_06_01"
>General</A
></DT
><DT
>9.6.2. <A
HREF="sect_09_06.html#sect_09_06_02"
>Submenus</A
></DT
></DL
></DD
><DT
>9.7. <A
HREF="sect_09_07.html"
>The shift built-in</A
></DT
><DD
><DL
><DT
>9.7.1. <A
HREF="sect_09_07.html#sect_09_07_01"
>What does it do?</A
></DT
><DT
>9.7.2. <A
HREF="sect_09_07.html#sect_09_07_02"
>Examples</A
></DT
></DL
></DD
><DT
>9.8. <A
HREF="sect_09_08.html"
>Summary</A
></DT
><DT
>9.9. <A
HREF="sect_09_09.html"
>Exercises</A
></DT
></DL
></DIV
><BLOCKQUOTE
CLASS="ABSTRACT"
><DIV
CLASS="abstract"
><A
NAME="AEN5864"
></A
><P
></P
><P
>Upon completion of this chapter, you will be able to</P
><P
>&#13;<P
></P
><UL
><LI
><P
>Use <B
CLASS="command"
>for</B
>, <B
CLASS="command"
>while</B
> and <B
CLASS="command"
>until</B
> loops, and decide which loop fits which occasion.</P
></LI
><LI
><P
>Use the <B
CLASS="command"
>break</B
> and <B
CLASS="command"
>continue</B
> Bash built-ins.</P
></LI
><LI
><P
>Write scripts using the <B
CLASS="command"
>select</B
> statement.</P
></LI
><LI
><P
>Write scripts that take a variable number of arguments.</P
></LI
></UL
></P
><P
></P
></DIV
></BLOCKQUOTE
></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="sect_08_04.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="sect_09_01.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Exercises</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The for loop</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>