# Sample Txt to HTML script # Will Work in BASH or CSH # Be Sure to Make Any Modification Necessary # Version 1.0 - 5/20/94 # By Michael Stefanini - Jet Propulsion Laboratory # mstef@jpl-edm.jpl.nasa.gov # or # stefam@rpi.edu #--------------------------- #INSTRUCTIONS: # Create a TXT file called FILENAME (no .HTM extension) # Type TXT2HTML FILENAME # Enter the Information required # The NEXT, PREV, and HOME are optional links. You need not fill # these in # The script will create the HTML file and all it FILENAME.html #------------------------------------------------------------- # This is Part One where the User Enters Document Information echo -n "Title : " read NAME TITLE="Document: $NAME" echo -n echo -n "Heading 1 : " read HEADING HEADING="Document: $HEADING" echo -n "Heading 2 : " read HEADING2 echo -n # These are the Navigation Button Links to Next, Previous, and Home # Documents echo -n "Prev : " read PREV echo -n echo -n "Next : " read NEXT echo -n echo -n "Home : " read HOME theDate=`date` # This is Part 2 where the header information is placed in a Temp File echo "" >/tmp/txt2html.$USER echo "
" >>/tmp/txt2html.$USER echo "" >>/tmp/txt2html.$USER echo "
" >>/tmp/txt2html.$USER echo "
" >>/tmp/txt2html.$USER # This is Part 3 where the Document is Added to the Temp and an OPTIONAL # SED is run to replace Forbidden Characters # sed -f maskfile $1 >> /tmp/txt2html.$USER cat $1 >> /tmp/txt2html.$USER # This is Part 4 where the closing remarks are placed and Navigation # Buttons are added echo "" >>/tmp/txt2html.$USER echo "
" >>/tmp/txt2html.$USER # Date Last Updated echo "
" >>/tmp/txt2html.$USER
# If Links Were Entered, then the Script will Add them. If no links
# Were entered, the script will display a minor error. Ignore it.
# IMPORTANT: You must have GIFs labeled :
# next.gif, prev.gif, home.gif
# In a Sub-Directory called ICONS
if [ $PREV != "" ]; then
echo "
" >>/tmp/txt2html.$USER
fi
if [ $HOME != "" ]; then
echo "
" >>/tmp/txt2html.$USER
fi
if [ $NEXT != "" ]; then
echo "
" >>/tmp/txt2html.$USER
fi
# This Closes the Document
echo "