Projet

Général

Profil

Actions

Eval101 » Historique » Révision 5

« Précédent | Révision 5/7 (diff) | Suivant »
François Rioult, 22/06/2010 22:30


Eval101

Synopsis

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

Parameters

1 parameter, treated as the command to be executed. The command can contains spaces, such as ls -al, date -R.

Inputs

No input

Outputs

1 output: the result of the command

Shell code

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

$cmd > $output

Example

This operator can be used for generating a file, containing the current date for example, with "date" as a parameter.

See the scenario missing.aws, where this operator initiates an "empty" file with only the date for a "for" loop.

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