------------------------------------------------------------------ script to create index page, thumbnail index page and ALL.html ------------------------------------------------------------------ #!/bin/bash # mkpgitp - create index and ALL pages and thumbnail page # 28 oct 2013 - john http://johnmeister.com - updated 8 may 2015 # updated date in title to 2017 - 30 Dec 2016 - update 1jan2018 # updating 12 Sep 2018 - not saving IMG.html, updating missing.html # updated 2 Dec 2018 to include g7x and g3x # 12 Jan 2019 - updating to create index page, and ALL.html # 14 Jan 2019 - updating to create thumbnail indexpage ################################################################# # mkpgitp - creates a page to display all images in a directory ################################################################# CAT=/usr/bin/cat CP=/usr/bin/cp DATE=`date | cut -c 5-11` ; export DATE # echo $DATE FDATE=`/bin/date +%d%b%y-%H%M` ; export FDATE # echo $FDATE GREP=/usr/bin/grep GREPV="/usr/bin/grep -v" LS=/usr/bin/ls LSF="/usr/bin/ls -F" MKDIR=/usr/bin/mkdir MV=/usr/bin/mv PERL=/usr/bin/perl RM=/usr/bin/rm SED=/usr/bin/sed SORT=/usr/bin/sort TITLE="`echo "$1 $2 $3 $4 $5 $6 $7 $8"`" ; export TITLE ; echo $TITLE UNIQU="/usr/bin/uniq -u" VI=/usr/bin/vi WCL="/usr/bin/wc -l" ############################################## # create backup copies of ALL, Header, Readme and footer files ############################################## $MKDIR X 2>/dev/null $MV ALL.html X/ALL.html-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV index.html X/index.html-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV README.html X/README-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV HEADER.html X/HEADER-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV FOOTER.html X/FOOTER-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null ############################################## $CP /home/luser/apache/README.html README.html $CP /home/luser/apache/HEADER.html HEADER.html $LS X ############################################## echo "$TITLE - john meister © 2019" > ALL.html echo "$TITLE - john meister © 2019" > index.html echo "$TITLE - john meister © 2019" > tindex.html ######################################################################################## ## NOTE: contents of /home/luser/bin/BASE/ A and B at bottom of this page ########## ######################################################################################## $CAT /home/luser/bin/BASE/A >> ALL.html $CAT /home/luser/bin/BASE/A >> index.html $CAT /home/luser/bin/BASE/A >> tindex.html ############################################## echo "" >> ALL.html echo "" >> index.html echo "" >> tindex.html echo "

$TITLE

" >> ALL.html #### echo "
fotomeister © 2019
" >> index.html #### echo "
fotomeister © 2019
" >> tindex.html #### echo "
" >> index.html echo "
" >> tindex.html #### echo "

$TITLE

" >> index.html echo "

$TITLE

" >> tindex.html #### echo "
" >> index.html echo "
" >> tindex.html ############################################## # image tags and place D850, D750, P1000, canon files ############################################## $LS *.jpg > IMGs 2>/dev/null $LS *.JPG >> IMGs 2>/dev/null $CAT IMGs | $GREP JM8 > IMG.html 2>/dev/null $CAT IMGs | $GREP G7X >> IMG.html 2>/dev/null $CAT IMGs | $GREP G3X >> IMG.html 2>/dev/null $CAT IMGs | $GREP IMG >> IMG.html 2>/dev/null $CAT IMGs | $GREP DSCN >> IMG.html 2>/dev/null $CAT IMGs | $GREP JM7 >> IMG.html 2>/dev/null $CAT IMGs | $GREP JM6 >> IMG.html 2>/dev/null $CAT IMGs | $GREP D7K >> IMG.html 2>/dev/null $CAT IMGs | $GREP JEM >> IMG.html 2>/dev/null $LS *.jpg *.JPG 2>/dev/null | $GREP -v JM8 | $GREP -v G7X | $GREP -v G3X | $GREP -v JM7 | $GREP -v JM6 | $GREP -v DSCN | $GREP -v JEM | $GREP -v IMG >> IMG.html 2>/dev/null ############################################## $CP IMG.html LIMG.html # creating copy of sorted files for links for index.html $CP IMG.html LIMGT.html # creating copy of sorted files for links for tindex.html ############################################## $PERL -pi -e 's/(.*)/
$1
/g' IMG.html 2>/dev/null $PERL -pi -e 's/

//g' IMG.html 2>/dev/null ############################################## $CAT IMG.html >> ALL.html echo "" >> ALL.html $CAT /home/luser/bin/BASE/B >> ALL.html ############################################## $LSF | $GREP / | $GREPV X > DIRL.txt $SED -i.bak 's$/$$g' DIRL.txt $SED -i.bak 's$.*$&
$g' DIRL.txt 2>/dev/null $SED -i.bak 's$
$$g' DIRL.txt 2>/dev/null ############################################## $SED -i.bak 's$.*$&
$g' LIMG.html 2>/dev/null $SED -i.bak 's$
$$g' LIMG.html 2>/dev/null ############################################## echo "
select ALL.html to view all pictures in this directory: " >> index.html echo "ALL.html
" >> index.html echo "all with thumbnails

" >> index.html echo "
" >> index.html $CAT LIMG.html >> index.html echo "

Additional Directories:
" >> index.html $CAT DIRL.txt >> index.html echo "
" >> index.html $CAT /home/luser/bin/BASE/B >> index.html ############################################## $SED -i.bak 's$.*$ - &$g' LIMGT.html 2>/dev/null $SED -i.bak 's$ - $$g' LIMGT.html 2>/dev/null ############################################## echo "
select ALL.html to view all pictures in this directory: " >> tindex.html echo "ALL.html

" >> tindex.html echo "
" >> tindex.html $CAT LIMGT.html >> tindex.html echo "

" >> tindex.html echo "



Additional Directories:
" >> tindex.html $CAT DIRL.txt >> tindex.html echo "
" >> tindex.html $CAT /home/luser/bin/BASE/B >> tindex.html ############################################## $MV DIRL.txt X/DIRL.txt-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV IMG.html X/IMG.html-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV LIMG.html X/LIMG.html-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $MV LIMGT.html X/LIMGT.html-`/bin/date +%Y-%m-%d-%Hh%Mm` 2>/dev/null $RM IMGs $RM *.bak ############################################## -------------------------------------------------------------------------------------------------- /home/luser/bin/BASE/A: --------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------- /home/luser/bin/BASE/B: --------------------------------------------------------------------------------------------------

JohnMeister.com Today's Date:

Simply Linux: Basics  Full Size Jeep Buyer's Guide Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
Linux Tackles Microsoft
Video Course:
The Art of Linux System Administration, and a
Study Guide for the LPIC-2 Certification Exams.

-- O'Reilly Media author info
FULL SIZE JEEP

Buyer's Guide

SJ Jeeps

"Jeep is America's
only real sports car."
-Enzo Ferrari


Mercedes, VW, and other Diesels
Nikon cameras
general tech info
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it
installed locally in WA at:

- Northland Diesel 360.676.1970 - Bellingham
- Midway Auto 360.668.7111 - Clearview/Snohomish
- Fleet Services 425.355.4440 - Everett