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

258 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Writing and debugging scripts</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_01_07.html"><LINK
REL="NEXT"
TITLE="Creating and running a script"
HREF="sect_02_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_01_07.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sect_02_01.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="chap_02"
></A
>Chapter 2. Writing and debugging scripts</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>2.1. <A
HREF="sect_02_01.html"
>Creating and running a script</A
></DT
><DD
><DL
><DT
>2.1.1. <A
HREF="sect_02_01.html#sect_02_01_01"
>Writing and naming</A
></DT
><DT
>2.1.2. <A
HREF="sect_02_01.html#sect_02_01_02"
>script1.sh</A
></DT
><DT
>2.1.3. <A
HREF="sect_02_01.html#sect_02_01_03"
>Executing the script</A
></DT
></DL
></DD
><DT
>2.2. <A
HREF="sect_02_02.html"
>Script basics</A
></DT
><DD
><DL
><DT
>2.2.1. <A
HREF="sect_02_02.html#sect_02_02_01"
>Which shell will run the script?</A
></DT
><DT
>2.2.2. <A
HREF="sect_02_02.html#sect_02_02_02"
>Adding comments</A
></DT
></DL
></DD
><DT
>2.3. <A
HREF="sect_02_03.html"
>Debugging Bash scripts</A
></DT
><DD
><DL
><DT
>2.3.1. <A
HREF="sect_02_03.html#sect_02_03_01"
>Debugging on the entire script</A
></DT
><DT
>2.3.2. <A
HREF="sect_02_03.html#sect_02_03_02"
>Debugging on part(s) of the script</A
></DT
></DL
></DD
><DT
>2.4. <A
HREF="sect_02_05.html"
>Summary</A
></DT
><DT
>2.5. <A
HREF="sect_02_06.html"
>Exercises</A
></DT
></DL
></DIV
><BLOCKQUOTE
CLASS="ABSTRACT"
><DIV
CLASS="abstract"
><A
NAME="AEN1338"
></A
><P
></P
><P
>After going through this chapter, you will be able to:</P
><P
><P
></P
><UL
><LI
><P
>Write a simple script</P
></LI
><LI
><P
>Define the shell type that should execute the script</P
></LI
><LI
><P
>Put comments in a script</P
></LI
><LI
><P
>Change permissions on a script</P
></LI
><LI
><P
>Execute and debug a script</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_01_07.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_02_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"
>Creating and running a script</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>