File: shellscript.html

package info (click to toggle)
ant-contrib 1.0~b3%2Bsvn177-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,008 kB
  • sloc: java: 12,697; xml: 2,674; makefile: 7
file content (140 lines) | stat: -rw-r--r-- 4,256 bytes parent folder | download | duplicates (6)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Ant-contrib Tasks: ShellScript</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 644  (Linux)">
	<META NAME="CREATED" CONTENT="20030313;10303100">
	<META NAME="CHANGED" CONTENT="20030318;15221000">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1>ShellScript</H1>
<P>Task definition for the <CODE>shellscript</CODE> task. This task
allows the user to execute a script against a particular shell
program on a machine. It is an extension of the &quot;exec&quot;
task, and as such, supports the same attributes. One can however use
&quot;shell&quot; instead of &quot;executable&quot;. Also the
&quot;command&quot; attribute is not allowed. See the ANT
documentation for a description of the &lt;exec&gt; task parameters.</P>
<H2>Parameters</H2>
<TABLE WIDTH=854 BORDER=1 CELLPADDING=2 CELLSPACING=0>
	<COL WIDTH=84>
	<COL WIDTH=670>
	<COL WIDTH=86>
	<TR>
		<TH WIDTH=84>
			<P>Attribute</P>
		</TH>
		<TH WIDTH=670>
			<P>Description</P>
		</TH>
		<TH WIDTH=86>
			<P>Required</P>
		</TH>
	</TR>
	<TR>
		<TD WIDTH=84 VALIGN=TOP>
			<P>shell</P>
		</TD>
		<TD WIDTH=670 VALIGN=TOP>
			<P>The name of the shell executable which is to be executed. This
			shell must support taking a single parameter whose value is a
			script file which is to be executed. 
			</P>
		</TD>
		<TD WIDTH=86>
			<P>Yes</P>
		</TD>
	</TR>
	<TR>
		<TD WIDTH=84 VALIGN=TOP>
			<P>executable</P>
		</TD>
		<TD WIDTH=670 VALIGN=TOP>
			<P>Same as “shell”</P>
		</TD>
		<TD WIDTH=86>
			<P><BR>
			</P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=84>
			<P>tmpsuffix</P>
		</TD>
		<TD WIDTH=670>
			<P>The contents of the script are placed in a temporary file. This
			attribute is the extension to use. <B>note: </B>The value must
			contain any dots required. This attribute is usefull for using
			script files with windows 
			</P>
		</TD>
		<TD WIDTH=86>
			<P>No</P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=84>
			<P>inputstring</P>
		</TD>
		<TD WIDTH=670>
			<P>This is placed in the script file.</P>
		</TD>
		<TD WIDTH=86>
			<P>No</P>
		</TD>
	</TR>
</TABLE>
<H2>Nested Text</H2>
<P>Any nested text is treated as the contents of the script that is
to be executed within the shell. Embedded ant properties will be
converted.</P>
<H2>Examples</H2>
<PRE>        &lt;shellscript shell=&quot;bash&quot; dir=&quot;${src.mib.dir}&quot;&gt;
           mibgen -i ../include mib.mib -c ${build.gen.dir}/generated.cpp
           mibgen -i ../include mib.mib -h ${build.gen.dir}/generated.h
        &lt;/shellscript&gt;

        &lt;shellscript shell=&quot;sed&quot; outputproperty=&quot;sed.output&quot;&gt;
          &lt;arg value=&quot;-e&quot;/&gt;
          &lt;arg value=&quot;s/FOO/BAR/g&quot;/&gt;
          FOO bar bar bar FOO bar bar
        &lt;/shellscript&gt;

        &lt;shellscript shell=&quot;cmd.exe&quot; tmpsuffix=&quot;.bat&quot;&gt;
          &lt;arg value=&quot;/c&quot;/&gt;
          &lt;arg value=&quot;call&quot;/&gt;
          echo hello world
        &lt;/shellscript&gt;

        &lt;shellscript shell=&quot;bash&quot;
          dir=&quot;${build.bin.dir}&quot;
          inputstring=&quot;ls -rt | tail -n 1&quot;
          outputproperty=&quot;last.bin.file&quot;/&gt;

        &lt;shellscript executable=&quot;perl&quot;&gt;
          print STDOUT &quot;Hello World!\n&quot;;
        &lt;/shellscript&gt;

        &lt;shellscript shell=&quot;sh&quot; dir=&quot;${thirdparty.dist.dir}/lib&quot;&gt;
          rm *.so
          for file in *.0
          do
            x=`echo $file | sed -e's/.0.1.0//'`
            ln -s $file $x
          done
        &lt;/shellscript&gt;</PRE><P>
<BR><BR>
</P>
<P><B>Warning:</B></P>
<P STYLE="margin-left: 0.79in">One should be carefull in using
<I>shellscript</I>, as overuse will make your build files difficult
to understand, to maintain and to support multiplatform builds. Use
of <I>cygwin</I> in a windows environment will help. However one
should strive to use the java tasks whereever possible.</P>
<PRE STYLE="margin-bottom: 0.2in">    </PRE>
<HR>
<P ALIGN=CENTER>Copyright &copy; 2003 Ant-Contrib Project. All rights
Reserved.</P>
</BODY>
</HTML>