#!/bin/sh ## ## SCRIPT: 00_multi-pdf-files_linksDownHTMLpage_echo_for-loop.sh ## ## PURPOSE: Generate an HTML file providing links to a set of ## user-selected '.pdf' files in the current directory. ## ## NOTE: ## Many old texts, such as math texts from the 1800's, are ## available on line via projects such as the Gutenberg project. ## ## This utility makes it easy to make a collection of such ## 'ebooks' available via an HTML page. ## ## METHOD: Uses the 'echo' command to build the HTML statments. ## ## Shows the HTML file in HTML-viewer $HTMLVIEWER, and ## starts-up the HTML file in the editor $TXTEDITOR. ## ## $HTMLVIEWER and $TXTEDITOR can be set by the user. ## ## This script puts the '.htm' HTML file in the directory ## with the '.pdf' files. ## ## HOW TO USE: Using the Nautilus file manager, navigate to a ## directory and select a set of '.pdf' files. ## Right-click and choose this script to run (name above). ## ########################################################################### ## Script ## Created: 2012feb28 Based on a similar script in the 'IMAGEtools' group. ## Changed: 2012mar04 Put the ... string on 2 lines. ## Changed: 2012may11 Changed script name in comments above and touched up ## the comments. ####################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################### ## Set the htm output file name. ################################### # HTMFILE="temp.htm" HTMFILE="00_temp_PDFfileLINKS_downThePage.htm" if test -f "$HTMFILE" then rm "$HTMFILE" fi ####################################### ## Get the current directory. ####################################### CURDIR="`pwd`" ####################################### ## Put the 'head', 'title', and 'intro' ## sections in the HTML file. ####################################### echo "
Title Goes Here - PDF Filessubtitle goes here |
More links may be added in the future.
Introduction :
|
START of PDF LINKS :
|
Bottom of the Title Goes Here - PDF Files page.
To return to a previously visited web page location, click on the
< Go to Start of PDF links, above. >
|
" >> "$HTMFILE" ################################### ## SHOW HTML FILE in a web browser. ################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $HTMLVIEWER "$HTMFILE" & ################################## ## Put HTML FILE in a text editor. ################################## $TXTEDITOR "$HTMFILE"