Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if $# -eq 0
- then
- echo 'Error: not enough arguments!\n'
- else
- #mas[$1]
- #mas[0]=0
- #mas[1]=1
- declare -a mas
- mas[0]=0
- mas[1]=1
- a=0
- b=1
- i=2
- while $i -le $1
- do
- mas[$i]=$(expr $a + $b)
- a=$(expr $a + 1)
- b=$(expr $b + 1)
- i=$(expr $i + 1)
- done
- echo ${mas[*]}
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement