#!/bin/bash source llibreria.sh existeix $1 if [ $# -ne "1" ] then echo "Ús: $0 fitxer" >&2 exit 3 fi echo "Sumare fitxer $1" total=$((tr "\n" "+" < $1;echo "0")|bc) echo "La suma és $total" exit 0