#!/bin/sh ## ## SCRIPT: htm00_multi-movie-files_GENvidLinksDownHTMLpage_echo_for-loop.sh ## ## PURPOSE: Generate an HTML file with links to movie/video files down the page, ## in table cells, using the selected video files ## ('.mpg' and/or '.wmv' and/or '.flv' and/or etc.). ## ## METHOD: Builds the HTML page using the 'echo' command and the '>>' ## concatenation operator. ## ## In a 'for' loop on the user-selected filenames, links to ## the movie files are put down the HTML page. ## ## Shows the HTML file in $HTMLVIEWER (a web browser of the user's ## choice), and brings up the HTML file in $TEXTEDITOR (a GUI ## text editor of the user's choice). ## ## ## HOW TO USE: In Nautilus, select one or more movie/video files. ## (Can use the Ctl or Shift keys to select multiple files.) ## Then right-click and choose this script to run (name above). ## ## This script puts the '.htm' HTML file in the directory ## with the video files. ## ########################################################################### ## Started: 2011dec08 ## Changed: 2012may24 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ############################################################################## ## FOR TESTING: (show statements as they execute) # set -x ################################### ## Set the htm output file name. ################################### HTMFILE="00_temp_movieLinks_downPage.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 "mpg" -a "$FILEEXT" -ne "flv" -a # "$FILEEXT" -ne "wmv" -a "$FILEEXT" -ne "avi" -a # "$FILEEXT" -ne "mp4" -a "$FILEEXT" -ne "mkv" # then # continue # fi ######################################## ## Write out video-display statement --- ## in a table cell. ######################################## echo "

$FILECNT \ $FILENAME " >> "$HTMFILE" done ## END OF 'for FILENAME' loop. #################################################### ## END OF FILES LOOP. Write out bottom of HTML file. #################################################### echo "

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 Videos, above. >
< Go to Top of Page, above. >

Page created 2011 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"