aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBraxton Hall2022-10-25 06:41:38 +0000
committerGitHub2022-10-25 06:41:38 +0000
commitb55d59b1feba35d34813766b6a07ae788f150f91 (patch)
treedeb3499ccab9bc6b3d67988978eb24bb3ba72763
parent4a1bbcf2af6ff77bdbab0d9744453949e95b6b9b (diff)
parentccfa3ef5a9d811a003d6fa9701b9f1e27f44ce33 (diff)
Merge pull request #38 from braxtonhall/wc
Ruin my poor disk
-rw-r--r--entries/braxtonhall/wc/.gitignore1
-rw-r--r--entries/braxtonhall/wc/fib.sh22
-rw-r--r--people.json4
3 files changed, 27 insertions, 0 deletions
diff --git a/entries/braxtonhall/wc/.gitignore b/entries/braxtonhall/wc/.gitignore
new file mode 100644
index 0000000..f845a7d
--- /dev/null
+++ b/entries/braxtonhall/wc/.gitignore
@@ -0,0 +1 @@
+*.fib \ No newline at end of file
diff --git a/entries/braxtonhall/wc/fib.sh b/entries/braxtonhall/wc/fib.sh
new file mode 100644
index 0000000..fc419b3
--- /dev/null
+++ b/entries/braxtonhall/wc/fib.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+function rec () {
+
+ if [ $2 == "0" ]; then
+ :
+ elif [ $2 == "1" ]; then
+ [ -f "$1/$2.fib" ] || echo "🥵" > "$1/$2.fib"
+ else
+ [ -d "$1/$2" ] || mkdir "$1/$2"
+ rec "$1/$2" $(($2 - 1))
+ rec "$1/$2" $(($2 - 2))
+ fi
+}
+
+if [[ $1 =~ ^[0-9]+$ ]]; then
+ rec $(pwd) $1
+ find $(pwd)/$1 -type f | wc -l
+else
+ echo "Please provide a natural number!"
+ exit 1
+fi
diff --git a/people.json b/people.json
index 7c9b8a1..d0e4039 100644
--- a/people.json
+++ b/people.json
@@ -34,6 +34,10 @@
{
"name": "types",
"link": "./entries/braxtonhall/types/index.ts"
+ },
+ {
+ "name": "wc",
+ "link": "./entries/braxtonhall/wc/fib.sh"
}
]
},