(動画教材準備中)
plus : 引数の足し算
Usage : plus v1 v2 ...
Version : Mon Mar 18 16:59:00 JST 2013
$ plus 1 2 3 4
10
$ plus 1.21 2.345 -2.524
1.031
例2
パイプ処理の直後、パイプ各行のコマンドの結果ステータス
を足し算して、0ならばすべて正常終了、異なればエラー終了
である。
$ comman1 | command2 | command3 | ... > result
$ [ $(plus ${PIPESTATUS[@]}) -ne 0 ] && exit 1