Eval211 » Historique » Version 3
François Rioult, 22/06/2010 22:52
| 1 | 1 | François Rioult | h1. Eval211 |
|---|---|---|---|
| 2 | |||
| 3 | h2. Synopsis |
||
| 4 | |||
| 5 | This operator has two parameters, one input and one output. The corresponding shell script executes the parameters as a command on the input, and copies the result to the output. |
||
| 6 | |||
| 7 | h2. Parameters |
||
| 8 | |||
| 9 | 2 parameters, treated as the command to be executed. |
||
| 10 | |||
| 11 | h2. Inputs |
||
| 12 | |||
| 13 | 1 input file. |
||
| 14 | |||
| 15 | h2. Outputs |
||
| 16 | |||
| 17 | 1 output: the result of the command. |
||
| 18 | |||
| 19 | 3 | François Rioult | h2. Shell Code |
| 20 | |||
| 21 | <pre> |
||
| 22 | cmd=$1; shift |
||
| 23 | args=$1; shift |
||
| 24 | input=$1; shift |
||
| 25 | output=$1; shift |
||
| 26 | |||
| 27 | $cmd "$args" $input > $output |
||
| 28 | </pre> |
||
| 29 | |||
| 30 | 1 | François Rioult | h2. Example |
| 31 | |||
| 32 | 2 | François Rioult | This operator is used for applying a command with parameters, for example in [[CMAR.aws]] for filtering the pattern mining result with @sed -n 's/_//pg'@. |