From a182dddf3021c0519e114b12784468f3475894fe Mon Sep 17 00:00:00 2001 From: ganome Date: Thu, 9 Jul 2026 15:31:45 -0600 Subject: [PATCH] Added Shell Script for Generating all the files, with pre-existing file checks so the script won't try to rewrite the same manpages. --- Script/manpage2pdf.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 Script/manpage2pdf.sh diff --git a/Script/manpage2pdf.sh b/Script/manpage2pdf.sh new file mode 100755 index 0000000..09320c3 --- /dev/null +++ b/Script/manpage2pdf.sh @@ -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