summaryrefslogtreecommitdiff
path: root/doc/elglob.html
blob: 80c438de3e1c247bc74e6078c6b865e74c1649e9 (plain)
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
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <meta http-equiv="Content-Language" content="en" />
 <title>execline: the elglob command</title>
 <meta name="Description" content="execline: the elglob command" />
 <meta name="Keywords" content="execline command elglob pattern shell globbing" />
 <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
</head>
<body>

<p>
<a href="index.html">execline</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
<p />

<h1> The <tt>elglob</tt> program </h1>

<p>
<tt>elglob</tt> performs globbing on a pattern, then executes
another program.
</p>

<h2> Interface </h2>

<pre>
     elglob [ -v ] [ -w ] [ -s ] [ -m ] [ -e ] [ -0 ] <em>variable</em> <em>pattern</em> <em>prog...</em>
</pre>

<ul>
 <li> <tt>elglob</tt> performs
<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/glob.html">globbing</a>
on <em>pattern</em>. </li>
 <li> It then performs
<a href="el_substitute.html">variable substitution</a> on
<em>prog...</em>, using <em>variable</em> as key and the result of the
globbing as value. The value is always split: it contains as many words
as they are matches for the globbing pattern. </li>
 <li> <tt>elglob</tt> then execs into the modified <em>prog...</em>. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-v</tt>&nbsp;: verbose. If there is a problem while globbing, print
a warning message on stderr. </li>
 <li> <tt>-w</tt>&nbsp;: strict. If there is a problem while globbing, die
immediately. This is harsh - you probably don't need that option. </li>
 <li> <tt>-s</tt>&nbsp;: sort the matches. By default, the results are
left unsorted. </li>
 <li> <tt>-m</tt>&nbsp;: mark. Append a slash to each word that corresponds
to a directory. </li>
 <li> <tt>-e</tt>&nbsp;: no escape. Treat backslashes in <em>pattern</em>
literally; do not allow quoting of metacharacters in <em>pattern</em> via
backslashes. <strong>Warning</strong>: the
<a href="execlineb.html">execlineb</a> launcher
uses the backslash as their own escape character - if you want a
backslash to be passed to <tt>elglob</tt>, do not forget to <em>double</em>
it. </li>
 <li> <tt>-0</tt>&nbsp;: null globbing. By default, if <em>pattern</em>
matches nothing, it will be substituted as is (verbatim in one word). With
this option, if <em>pattern</em> matches nothing, it will be properly
substituted as zero word. </li>
</ul>

</body>
</html>