Projet

Général

Profil

Tee » Historique » Version 2

François Rioult, 22/06/2010 23:19

1 1 François Rioult
h1. Tee
2
3
# this shell is an alternative to the standard file saver of Ariane
4 2 François Rioult
# given a filename as parameter, it copies the input to it and the output.
5
h2. Synopsis
6 1 François Rioult
7 2 François Rioult
This operator has one parameter, one input and one output. The corresponding shell script copies the input to the output and to the file having the parameter as name.
8
9
It is an alternative to the standard file saver of Ariane and it allows to "rename" the input of a component.
10
11
h2. Parameters
12
13
1 parameter, treated as the name of the file to which the input it copied.
14
15
h2. Inputs
16
17
1 input, the input file
18
19
h2. Outputs
20
21
1 output: the result of the command
22
23
h2. Shell code
24
25 1 François Rioult
<pre>
26
filename=$1; shift
27
input=$1; shift
28
output=$1; shift
29
30
cat $input | tee $filename > $output
31
</pre>
32 2 François Rioult
33
h2. Example
34
35
This operator is mainly used for renaming the temporary file generated by Ariane, for example for invoking [[Weka]] (see [[perturbation-weka.aws]], that needs specific file extension.