Added Shell Script for Generating all the files, with pre-existing file checks so the script won't try to rewrite the same manpages.

This commit is contained in:
ganome 2026-07-09 15:31:45 -06:00
parent d2da2dd289
commit a182dddf30
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83

17
Script/manpage2pdf.sh Executable file
View File

@ -0,0 +1,17 @@
# Create a directory in the User's HOME to store the PDFs
mkdir -p ~/all_manpages_pdf
# Loop through all available man pages
for cmd in $(man -k . | awk '{print $1}'); do
# Define the output file path
output_file="${HOME}/all_manpages_pdf/${cmd}.pdf"
# Check if the file already exists
if [ -f "$output_file" ]; then
echo "Skipping $cmd (PDF already exists)"
continue
fi
# Convert to PDF if it does not exist
man -Tpdf "$cmd" > "$output_file" 2>/dev/null
done