Projet

Général

Profil

Actions

Eval201

Synopsis

This operator has two parameters and no input. The corresponding shell script executes the two parameters as a command, and copies the result in the output.

It is useful for commands with arguments, such as awk commands whose arguments include space, quotes, etc., that could not be written with only one parameter in eval101. It can also produce file with commands using the parameters given by Ariane.

Parameters

2 parameters, treated as the command to be executed.

Inputs

No input

Outputs

1 output: the result of the command

Shell code

cmd=$1; shift
args=$1; shift
output=$1; shift

$cmd $args > $output

Example

This operator can be used for generating a file with an awk instruction, for example:

awk '{for(i=1;i<=10;i++)printf("train.%d", i)} input > output

See the scenario perturbation.aws, where this operator uses echo for saving a parameter in a file.

Mis à jour par François Rioult il y a plus de 14 ans · 4 révisions