#!/bin/sh ## ## Nautilus ## SCRIPT: htm00_multi-img-files_imgsDownHTMLpage_addNOtextPerImg_echo_for-loop.sh ## ## PURPOSE: Generate an HTML file showing image files down the page, ## in table cells, one cell per row, using the selected image files ## --- '.jpg', '.png', '.gif' or whatever. ## ## DOES NOT add paragraph HTML for descriptive text to be added. ## ## METHOD: Uses 'echo' to generate the lines of the HTML output file. ## ## Shows the HTML file in an html-viewer of the user's choice ## ($HTMLVIEWER), and puts the user in edit mode on the HTML file ## using a text-editor of the user's choice ($TEXTEDITOR). ## ## ## HOW TO USE: In Nautilus, select one or more image files in a directory. ## Then right-click and select this script to run (name above). ## ## This script puts the '.htm' HTML file in the directory ## with the image files. ## ############################################################################ ## Started: 2013oct20 Based on script that DOES add paragraphs for text ## description of each image. ## Updated: 2013 ########################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################### ## Set the htm output file name. ################################### HTMFILE="00_temp_imgCells_downPage_noDescriptions.htm" # HTMFILE="temp.htm" if test -f "$HTMFILE" then rm "$HTMFILE" fi ####################################### ## Put the 'head', 'title', and 'intro' ## sections in the HTML file. ####################################### echo " Title Goes Here

Title Goes Here

subtitle goes here

A few more notes or links may be added.

Introduction :

" > "$HTMFILE" ################################### ## START THE LOOP on the filenames. ################################### FILECNT=0 for FILENAME do FILECNT=`expr $FILECNT + 1` # FILEEXT=`echo "$FILENAME" | cut -d'.' -f2` # if test "$FILEEXT" -ne "jpg" -a "$FILEEXT" -ne "JPG" -a # "$FILEEXT" -ne "gif" -a "$FILEEXT" -ne "GIF" -a # "$FILEEXT" -ne "png" -a "$FILEEXT" -ne "PNG" # then # continue # fi ######################################## ## Write out image-display statement --- ## in a table cell. ######################################## if test $FILECNT = 1 then RULELINE="" else RULELINE="
" fi echo " " >> "$HTMFILE" done #################################################### ## END OF FILES LOOP. Write out bottom of HTML file. #################################################### echo "

$RULELINE

 

Bottom of the Title Goes Here page.

To return to a previously visited web page location, click on the
Back button of your web browser, a sufficient number of times.
OR, use the History-list option of your web browser.
OR ...

< Go to Start of Images, above. >
< Go to Top of Page, above. >

Page created 2013 xxx 00.

" >> "$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. ################################## $TEXTEDITOR "$HTMFILE"