~ubuntu-branches/ubuntu/trusty/abs-guide/trusty-proposed

« back to all changes in this revision

Viewing changes to abs/HTML/nestedifthen.html

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-06-03 10:57:27 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20120603105727-rm7frl4feikr2swm
Tags: 6.5-1
* New upstream release
* debian/watch
  - updated
* debian/abs-guide.lintian-overrides
  - updated for new upstream code
* debian/control
  - bump Standards-Version to 3.9.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<HTML
3
 
><HEAD
4
 
><TITLE
5
 
>Nested if/then Condition Tests</TITLE
6
 
><META
7
 
NAME="GENERATOR"
8
 
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9
 
"><LINK
10
 
REL="HOME"
11
 
TITLE="Advanced Bash-Scripting Guide"
12
 
HREF="index.html"><LINK
13
 
REL="UP"
14
 
TITLE="Tests"
15
 
HREF="tests.html"><LINK
16
 
REL="PREVIOUS"
17
 
TITLE="Other Comparison Operators"
18
 
HREF="comparison-ops.html"><LINK
19
 
REL="NEXT"
20
 
TITLE="Testing Your Knowledge of Tests"
21
 
HREF="testtest.html"><META
22
 
HTTP-EQUIV="Content-Style-Type"
23
 
CONTENT="text/css"><LINK
24
 
REL="stylesheet"
25
 
HREF="common/kde-common.css"
26
 
TYPE="text/css"><META
27
 
HTTP-EQUIV="Content-Type"
28
 
CONTENT="text/html; charset=iso-8859-1"><META
29
 
HTTP-EQUIV="Content-Language"
30
 
CONTENT="en"><LINK
31
 
REL="stylesheet"
32
 
HREF="common/kde-localised.css"
33
 
TYPE="text/css"
34
 
TITLE="KDE-English"><LINK
35
 
REL="stylesheet"
36
 
HREF="common/kde-default.css"
37
 
TYPE="text/css"
38
 
TITLE="KDE-Default"></HEAD
39
 
><BODY
40
 
CLASS="SECT1"
41
 
BGCOLOR="#FFFFFF"
42
 
TEXT="#000000"
43
 
LINK="#AA0000"
44
 
VLINK="#AA0055"
45
 
ALINK="#AA0000"
46
 
STYLE="font-family: sans-serif;"
47
 
><DIV
48
 
CLASS="NAVHEADER"
49
 
><TABLE
50
 
SUMMARY="Header navigation table"
51
 
WIDTH="100%"
52
 
BORDER="0"
53
 
CELLPADDING="0"
54
 
CELLSPACING="0"
55
 
><TR
56
 
><TH
57
 
COLSPAN="3"
58
 
ALIGN="center"
59
 
>Advanced Bash-Scripting Guide: An in-depth exploration of the art of shell scripting</TH
60
 
></TR
61
 
><TR
62
 
><TD
63
 
WIDTH="10%"
64
 
ALIGN="left"
65
 
VALIGN="bottom"
66
 
><A
67
 
HREF="comparison-ops.html"
68
 
ACCESSKEY="P"
69
 
>Prev</A
70
 
></TD
71
 
><TD
72
 
WIDTH="80%"
73
 
ALIGN="center"
74
 
VALIGN="bottom"
75
 
>Chapter 7. Tests</TD
76
 
><TD
77
 
WIDTH="10%"
78
 
ALIGN="right"
79
 
VALIGN="bottom"
80
 
><A
81
 
HREF="testtest.html"
82
 
ACCESSKEY="N"
83
 
>Next</A
84
 
></TD
85
 
></TR
86
 
></TABLE
87
 
><HR
88
 
ALIGN="LEFT"
89
 
WIDTH="100%"></DIV
90
 
><DIV
91
 
CLASS="SECT1"
92
 
><H1
93
 
CLASS="SECT1"
94
 
><A
95
 
NAME="NESTEDIFTHEN"
96
 
></A
97
 
>7.4. Nested <TT
98
 
CLASS="REPLACEABLE"
99
 
><I
100
 
>if/then</I
101
 
></TT
102
 
> Condition Tests</H1
103
 
><P
104
 
>Condition tests using the <TT
105
 
CLASS="REPLACEABLE"
106
 
><I
107
 
>if/then</I
108
 
></TT
109
 
>
110
 
         construct may be nested. The net result is equivalent to using the
111
 
         <A
112
 
HREF="operations.html#LOGOPS1"
113
 
><I
114
 
CLASS="FIRSTTERM"
115
 
>&#38;&#38;</I
116
 
></A
117
 
> compound
118
 
         comparison operator.</P
119
 
><P
120
 
><TABLE
121
 
BORDER="0"
122
 
BGCOLOR="#E0E0E0"
123
 
WIDTH="100%"
124
 
><TR
125
 
><TD
126
 
><PRE
127
 
CLASS="PROGRAMLISTING"
128
 
>   1&nbsp;a=3
129
 
   2&nbsp;
130
 
   3&nbsp;if [ "$a" -gt 0 ]
131
 
   4&nbsp;then
132
 
   5&nbsp;  if [ "$a" -lt 5 ]
133
 
   6&nbsp;  then
134
 
   7&nbsp;    echo "The value of \"a\" lies somewhere between 0 and 5."
135
 
   8&nbsp;  fi
136
 
   9&nbsp;fi
137
 
  10&nbsp;
138
 
  11&nbsp;# Same result as:
139
 
  12&nbsp;
140
 
  13&nbsp;if [ "$a" -gt 0 ] &#38;&#38; [ "$a" -lt 5 ]
141
 
  14&nbsp;then
142
 
  15&nbsp;  echo "The value of \"a\" lies somewhere between 0 and 5."
143
 
  16&nbsp;fi</PRE
144
 
></TD
145
 
></TR
146
 
></TABLE
147
 
></P
148
 
><P
149
 
><A
150
 
HREF="bash2.html#CARDS"
151
 
>Example 36-4</A
152
 
> demonstrates a nested
153
 
         <TT
154
 
CLASS="REPLACEABLE"
155
 
><I
156
 
>if/then</I
157
 
></TT
158
 
> condition test.</P
159
 
></DIV
160
 
><DIV
161
 
CLASS="NAVFOOTER"
162
 
><HR
163
 
ALIGN="LEFT"
164
 
WIDTH="100%"><TABLE
165
 
SUMMARY="Footer navigation table"
166
 
WIDTH="100%"
167
 
BORDER="0"
168
 
CELLPADDING="0"
169
 
CELLSPACING="0"
170
 
><TR
171
 
><TD
172
 
WIDTH="33%"
173
 
ALIGN="left"
174
 
VALIGN="top"
175
 
><A
176
 
HREF="comparison-ops.html"
177
 
ACCESSKEY="P"
178
 
>Prev</A
179
 
></TD
180
 
><TD
181
 
WIDTH="34%"
182
 
ALIGN="center"
183
 
VALIGN="top"
184
 
><A
185
 
HREF="index.html"
186
 
ACCESSKEY="H"
187
 
>Home</A
188
 
></TD
189
 
><TD
190
 
WIDTH="33%"
191
 
ALIGN="right"
192
 
VALIGN="top"
193
 
><A
194
 
HREF="testtest.html"
195
 
ACCESSKEY="N"
196
 
>Next</A
197
 
></TD
198
 
></TR
199
 
><TR
200
 
><TD
201
 
WIDTH="33%"
202
 
ALIGN="left"
203
 
VALIGN="top"
204
 
>Other Comparison Operators</TD
205
 
><TD
206
 
WIDTH="34%"
207
 
ALIGN="center"
208
 
VALIGN="top"
209
 
><A
210
 
HREF="tests.html"
211
 
ACCESSKEY="U"
212
 
>Up</A
213
 
></TD
214
 
><TD
215
 
WIDTH="33%"
216
 
ALIGN="right"
217
 
VALIGN="top"
218
 
>Testing Your Knowledge of Tests</TD
219
 
></TR
220
 
></TABLE
221
 
></DIV
222
 
></BODY
223
 
></HTML
224
 
>
 
 
b'\\ No newline at end of file'