SHARE
TWEET

so cw6

LazySenpai Nov 13th, 2019 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if [ $# -ne 1 ]; then
  2.     echo zla liczba parametrow
  3. else
  4.     if [ -f $1 ]; then
  5.         min=`cat $1 | cut -f 1 -d" "`
  6.         max=$min
  7.         for i in `cat $1`; do
  8.             sum=`expr $sum + $i`
  9.             if [ $min -gt $i ]; then
  10.                 min=$i
  11.             fi
  12.             if [ $max -lt $i ]; then
  13.                 max=$i
  14.             fi
  15.         done
  16.         echo Suma=$sum
  17.         echo Minimalny=$min
  18.         echo Maksymalny=$max
  19.     else
  20.         echo parametr nie jest plikiem
  21.     fi
  22. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top