Debian Codegraph @

docs/manual/tasks/shellscript.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
5 <TITLE>Ant-contrib Tasks: ShellScript</TITLE>
6 <META NAME="GENERATOR" CONTENT="OpenOffice.org 644 (Linux)">
7 <META NAME="CREATED" CONTENT="20030313;10303100">
8 <META NAME="CHANGED" CONTENT="20030318;15221000">
9 </HEAD>
10 <BODY LANG="en-US" DIR="LTR">
11 <H1>ShellScript</H1>
12 <P>Task definition for the <CODE>shellscript</CODE> task. This task
13 allows the user to execute a script against a particular shell
14 program on a machine. It is an extension of the &quot;exec&quot;
15 task, and as such, supports the same attributes. One can however use
16 &quot;shell&quot; instead of &quot;executable&quot;. Also the
17 &quot;command&quot; attribute is not allowed. See the ANT
18 documentation for a description of the &lt;exec&gt; task parameters.</P>
19 <H2>Parameters</H2>
20 <TABLE WIDTH=854 BORDER=1 CELLPADDING=2 CELLSPACING=0>
21 <COL WIDTH=84>
22 <COL WIDTH=670>
23 <COL WIDTH=86>
24 <TR>
25 <TH WIDTH=84>
26 <P>Attribute</P>
27 </TH>
28 <TH WIDTH=670>
29 <P>Description</P>
30 </TH>
31 <TH WIDTH=86>
32 <P>Required</P>
33 </TH>
34 </TR>
35 <TR>
36 <TD WIDTH=84 VALIGN=TOP>
37 <P>shell</P>
38 </TD>
39 <TD WIDTH=670 VALIGN=TOP>
40 <P>The name of the shell executable which is to be executed. This
41 shell must support taking a single parameter whose value is a
42 script file which is to be executed.
43 </P>
44 </TD>
45 <TD WIDTH=86>
46 <P>Yes</P>
47 </TD>
48 </TR>
49 <TR>
50 <TD WIDTH=84 VALIGN=TOP>
51 <P>executable</P>
52 </TD>
53 <TD WIDTH=670 VALIGN=TOP>
54 <P>Same as “shell”</P>
55 </TD>
56 <TD WIDTH=86>
57 <P><BR>
58 </P>
59 </TD>
60 </TR>
61 <TR VALIGN=TOP>
62 <TD WIDTH=84>
63 <P>tmpsuffix</P>
64 </TD>
65 <TD WIDTH=670>
66 <P>The contents of the script are placed in a temporary file. This
67 attribute is the extension to use. <B>note: </B>The value must
68 contain any dots required. This attribute is usefull for using
69 script files with windows
70 </P>
71 </TD>
72 <TD WIDTH=86>
73 <P>No</P>
74 </TD>
75 </TR>
76 <TR VALIGN=TOP>
77 <TD WIDTH=84>
78 <P>inputstring</P>
79 </TD>
80 <TD WIDTH=670>
81 <P>This is placed in the script file.</P>
82 </TD>
83 <TD WIDTH=86>
84 <P>No</P>
85 </TD>
86 </TR>
87 </TABLE>
88 <H2>Nested Text</H2>
89 <P>Any nested text is treated as the contents of the script that is
90 to be executed within the shell. Embedded ant properties will be
91 converted.</P>
92 <H2>Examples</H2>
93 <PRE> &lt;shellscript shell=&quot;bash&quot; dir=&quot;${src.mib.dir}&quot;&gt;
94 mibgen -i ../include mib.mib -c ${build.gen.dir}/generated.cpp
95 mibgen -i ../include mib.mib -h ${build.gen.dir}/generated.h
96 &lt;/shellscript&gt;
97
98 &lt;shellscript shell=&quot;sed&quot; outputproperty=&quot;sed.output&quot;&gt;
99 &lt;arg value=&quot;-e&quot;/&gt;
100 &lt;arg value=&quot;s/FOO/BAR/g&quot;/&gt;
101 FOO bar bar bar FOO bar bar
102 &lt;/shellscript&gt;
103
104 &lt;shellscript shell=&quot;cmd.exe&quot; tmpsuffix=&quot;.bat&quot;&gt;
105 &lt;arg value=&quot;/c&quot;/&gt;
106 &lt;arg value=&quot;call&quot;/&gt;
107 echo hello world
108 &lt;/shellscript&gt;
109
110 &lt;shellscript shell=&quot;bash&quot;
111 dir=&quot;${build.bin.dir}&quot;
112 inputstring=&quot;ls -rt | tail -n 1&quot;
113 outputproperty=&quot;last.bin.file&quot;/&gt;
114
115 &lt;shellscript executable=&quot;perl&quot;&gt;
116 print STDOUT &quot;Hello World!\n&quot;;
117 &lt;/shellscript&gt;
118
119 &lt;shellscript shell=&quot;sh&quot; dir=&quot;${thirdparty.dist.dir}/lib&quot;&gt;
120 rm *.so
121 for file in *.0
122 do
123 x=`echo $file | sed -e's/.0.1.0//'`
124 ln -s $file $x
125 done
126 &lt;/shellscript&gt;</PRE><P>
127 <BR><BR>
128 </P>
129 <P><B>Warning:</B></P>
130 <P STYLE="margin-left: 0.79in">One should be carefull in using
131 <I>shellscript</I>, as overuse will make your build files difficult
132 to understand, to maintain and to support multiplatform builds. Use
133 of <I>cygwin</I> in a windows environment will help. However one
134 should strive to use the java tasks whereever possible.</P>
135 <PRE STYLE="margin-bottom: 0.2in"> </PRE>
136 <HR>
137 <P ALIGN=CENTER>Copyright &copy; 2003 Ant-Contrib Project. All rights
138 Reserved.</P>
139 </BODY>
140 </HTML>