summaryrefslogtreecommitdiff
path: root/copy
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 20:10:07 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 20:10:07 -0400
commit41039b36ec75467076ada2bb0f6f7866eafaea09 (patch)
treefb5733c9cd64c7aa8f3014193cb17011b0dfbbf5 /copy
parent1f19f33e45791ea59aed048796fc68672c6723a5 (diff)
feat: Main Page to search for man pages
Added a main index page that uses HTMX to search for man pages and place the contents on the page.
Diffstat (limited to 'copy')
-rwxr-xr-xcopy34
1 files changed, 34 insertions, 0 deletions
diff --git a/copy b/copy
new file mode 100755
index 00000000..8ec9a97c
--- /dev/null
+++ b/copy
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+NAME="$(basename "$0")"
+FROM="$1"
+TO="$2"
+
+usage() {
+ printf "Usage: %s from to\n" "$NAME"
+ printf "from The directory to copy from.\n"
+ printf "to The directory to copy to.\n"
+}
+
+if [[ ! -d "$FROM" ]];
+then
+ usage
+ exit 1
+fi
+
+if [[ ! -d "$TO" ]];
+then
+ usage
+ exit 1
+fi
+
+for i in {1..9};
+do
+ if [[ ! -e "$TO/man$i" ]];
+ then
+ mkdir "$TO/man$i"
+ fi
+
+ find "$FROM" -type f -name "*.$i" | xargs -I {} cp {} "$TO/man$i"
+done
+