Advertisement
cd62131

Multiply arguments

Jan 19th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.08 KB | None | 0 0
  1. #!/bin/bash
  2. typeset -gi prod=1
  3. for i in $@; do
  4.   ((prod *= i))
  5. done
  6. echo ${prod}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement