Advertisement
Niksko

Mult.sh

Nov 2nd, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. #!/bin/bash
  2. if [ $# != 0 ]
  3. then
  4.     echo "Please don't enter arguments"
  5.     exit
  6. else
  7.     echo "Reading integers from file"
  8.     exec < /home/niksko/inFile
  9.     ans=1
  10.     while read line
  11.     do
  12.         ans=$(($line * $ans))
  13.     done
  14.     echo $ans
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement