Last active
March 16, 2019 11:16
-
-
Save marek-saji/119ae9d2166958f931b619776f835898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# GistID: 119ae9d2166958f931b619776f835898 | |
set -e | |
minus2= | |
minus1= | |
for i in $( seq 0 $(( $1 - 1 )) ) | |
do | |
if [ -z "$minus2" ] || [ -z "$minus1" ] | |
then | |
n="$i" | |
else | |
n=$(( minus1 + minus2 )) | |
fi | |
printf '%d ' "$n" | |
minus2="$minus1" | |
minus1="$n" | |
done | |
printf '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment