SHARE
TWEET

Untitled

GangBoss Oct 9th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ "$1" == "--help" ] || [ "$1" -lt 1 ] || [ "$1" == "-h" ]; then
  4. echo calculate fibunachi number for argument that bigger then 0 and less then 94
  5. exit
  6. fi
  7.  
  8. tmp=1
  9. result=0
  10.  
  11. for (( i=1; $i<$1; i++))
  12. do
  13.     let "result = result + tmp"
  14.     let "tmp = result - tmp"
  15. done
  16.  
  17. echo "$result"
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top