Skip to content

Instantly share code, notes, and snippets.

@marek-saji
Last active March 16, 2019 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marek-saji/119ae9d2166958f931b619776f835898 to your computer and use it in GitHub Desktop.
Save marek-saji/119ae9d2166958f931b619776f835898 to your computer and use it in GitHub Desktop.
#!/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