This file is indexed.

/usr/share/doc/pyxplot/html/sect0036.html is in pyxplot-doc 0.8.4-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="plasTeX" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>PyXPlot Users' Guide: Foreach Loops</title>

<link href="ex-meansd.html" title="Foreach Datum Loops" rel="next" />
<link href="sect0035.html" title="For Loops" rel="prev" />
<link href="sect0031.html" title="Programming and Flow Control" rel="up" />
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>

<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0035.html" title="For Loops"><img alt="Previous: For Loops" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>

<td><a href="sect0031.html" title="Programming and Flow Control"><img alt="Up: Programming and Flow Control" border="0" src="icons/up.gif" width="32" height="32" /></a></td>

<td><a href="ex-meansd.html" title="Foreach Datum Loops"><img alt="Next: Foreach Datum Loops" border="0" src="icons/next.gif" width="32" height="32" /></a></td>

<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>

<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>

<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>

<div class="breadcrumbs">
<span>
<span>
<a href="index.html">PyXPlot Users' Guide</a> <b>:</b>
</span>

</span><span>
<span>
<a href="sect0001.html">Introduction to PyXPlot</a> <b>:</b>
</span>

</span><span>
<span>
<a href="sect0031.html">Programming and Flow Control</a> <b>:</b>
</span>

</span><span>

<span>
<b class="current">Foreach Loops</b>
</span>
</span>
<hr />
</div>

<div><h1 id="a0000000037">6.4 Foreach Loops</h1>
<p> <a name="a0000000584" id="a0000000584"></a> <a name="a0000000585" id="a0000000585"></a> </p><p>Foreach loops may be used to run a script block once for each item in a list. The list may either take the form of an explicit bracketed comma-separated list of items, or the form of one or more filename wildcards, as in the following examples: </p><pre>
foreach x in (-1,pi,10)
 {
  print x
 }

foreach x in "*.dat"
 {
  print x
 }
</pre><p>The first of these loops would iterate three times, with the variable <tt class="tt">x</tt> holding the values <img src="images/img-0155.png" alt="$-1$" style="vertical-align:0px; 
                                     width:21px; 
                                     height:12px" class="math gen" />, <img src="images/img-0136.png" alt="$\pi $" style="vertical-align:0px; 
                                     width:11px; 
                                     height:8px" class="math gen" /> and <img src="images/img-0295.png" alt="$10$" style="vertical-align:0px; 
                                     width:17px; 
                                     height:12px" class="math gen" /> in turn. The second of these loops would search for any datafiles in the user’s current directory with filenames ending in <tt class="tt">.dat</tt> and iterate for each of them. As previously, the wildcard character <tt class="tt">*</tt> matches any string of characters, and the character <tt class="tt">?</tt> matches any single character. Thus, <tt class="tt">foo?.dat</tt> would match <tt class="tt">foo1.dat</tt> and fooX.dat, but not <tt class="tt">foo.dat</tt> or <tt class="tt">foo10.dat</tt>. The effect of the <tt class="tt">print</tt> statement in this particular example would be rather similar to typing: </p><pre>
!ls *.dat
</pre><p>The quotes around each supplied search string are compulsory if any of the characters in the search string are alphanumeric, but optional otherwise. Since both of the wildcard characters <tt class="tt">*</tt> and <tt class="tt">?</tt> are non-alphanumeric, the quotes are compulsory in most useful cases. An error is returned if there are no files in the present directory which match the supplied wildcard. The following example would produce plots of all of the datafiles in the current directory with filenames <tt class="tt">foo_*.dat</tt> or <tt class="tt">bar_*.dat</tt> as <tt class="tt">eps</tt> files with matching filenames: </p><pre>
set terminal eps
foreach x in "foo_*.dat" "bar_*.dat"
 {
  outfilename =  x
  outfilename =~ s/dat/eps/
  set output outfilename
  plot x using 1:2
 }
</pre></div>





<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0035.html" title="For Loops"><img alt="Previous: For Loops" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>

<td><a href="sect0031.html" title="Programming and Flow Control"><img alt="Up: Programming and Flow Control" border="0" src="icons/up.gif" width="32" height="32" /></a></td>

<td><a href="ex-meansd.html" title="Foreach Datum Loops"><img alt="Next: Foreach Datum Loops" border="0" src="icons/next.gif" width="32" height="32" /></a></td>

<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>

<td><a href="sect0255.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>

<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>

<script language="javascript" src="icons/imgadjust.js" type="text/javascript"></script>

</body>
</html>