RosettaCodeData/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-2.sh
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

12 lines
164 B
Bash

fn accumulator n {
result @ i {
n = `{echo $n + $i | bc}
result $n
}
}
fn-x = <={accumulator 1}
x 5
fn-y = <={accumulator 3}
echo <={x 2.3}
echo <={y -3000}