1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/bin/bash max=20 n_2=1 n_1=1 echo 1 - ${n_2} echo 2 - ${n_1} i=3 while [ ${i} -le ${max} ]; do n=$((${n_2} + ${n_1})) n_2=${n_1} n_1=${n} echo ${i} - ${n} i=$((${i}+1)) done |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/bin/bash max=20 n_2=1 n_1=1 echo 1 - ${n_2} echo 2 - ${n_1} i=3 while [ ${i} -le ${max} ]; do n=$((${n_2} + ${n_1})) n_2=${n_1} n_1=${n} echo ${i} - ${n} i=$((${i}+1)) done |