diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 20:10:07 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 20:10:07 -0400 |
| commit | 41039b36ec75467076ada2bb0f6f7866eafaea09 (patch) | |
| tree | fb5733c9cd64c7aa8f3014193cb17011b0dfbbf5 /copy | |
| parent | 1f19f33e45791ea59aed048796fc68672c6723a5 (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-x | copy | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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 + |
