Pour additionner tous les nombres envoyés par la sortie standard, par exemple :
~: seq 1 5 1 2 3 4 5
Vous pouvez utiliser la commande awk :
~: seq 1 5 | awk '{ total+=$1 } END { print total }'
15Pour additionner tous les nombres envoyés par la sortie standard, par exemple :
~: seq 1 5 1 2 3 4 5
Vous pouvez utiliser la commande awk :
~: seq 1 5 | awk '{ total+=$1 } END { print total }'
15
Poster un nouveau commentaire