Coding Through the Alphabet - Fibonacci in Zsh
Zsh is a Unix shell and scripting language that extends Bourne shell with many improvements. It is the default shell on macOS and is widely used on Linux.
How to test
Prerequisites: Zsh (pre-installed on macOS; available on all Unix/Linux systems)
- Ubuntu/Debian:
sudo apt install zsh
zsh fibonacci.zsh
Expected output:
0
1
1
2
3
5
8
13
21
34
Source Code
#!/usr/bin/env zsh
a=0
b=1
for i in {1..10}; do
echo $a
c=$((a + b))
a=$b
b=$c
done
Local Testing Screenshot
