aboutsummaryrefslogtreecommitdiff
path: root/entries/braxtonhall/wc/fib.sh
blob: c9096179cdea6fee81fdc972304b081cfc2f46d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

rec () {
    shopt -s nullglob dotglob

    if [ $2 == "0" ]; then
        :
    elif [ $2 == "1" ]; then
        echo "🥵" > "$1/$2.fib"
    else
        mkdir "$1/$2"
        rec "$1/$2" $(($2 - 1))
        rec "$1/$2" $(($2 - 2))
    fi
}

rec $(pwd) $1
find $(pwd)/$1 -type f | wc -l