#!/bin/bash # touchhtml # script for touching my HTML template file # by Haiyong Zheng # website: http://www.flyzhy.org/ # ANSI color definition # Attribute: # 0-off 1-bold(bright) 2-light(default) 4-underline 5-twinkle 7-reversal # ForeGround: # 30-black 31-red 32-green 33-yellow 34-blue 35-magenta 36-bluer 37-white # BackGround: # 40-black 41-red 42-green 43-yellow 44-blue 45-magenta 46-bluer 47-white # Format: \033[Attribute;ForeGround;BackGroundm # ie: # NORMAL="\[\033[0m\]" # BRIGHT_MAGENTA_RED="\[\033[1;35;41m\]" echo -ne "Creating Standard XHTML 1.0 Strict template html file with \033[1;30;43mtitle\033[0m, \033[1;30;43mkeywords\033[0m, \033[1;30;43mdescription\033[0m, \033[1;30;43mheading\033[0m, and \033[1;30;43mdate\033[0m.\n" echo -ne "Welcome to my homepage \033[2;33;44m http://www.flyzhy.org/\033[0m\n" echo -ne "\n" if [ $# -ne 1 ]; then echo -ne "Usage: $0 filename.html\n"; exit 1; fi echo -ne "\n" echo -ne "#########################################\n" echo -ne "# \033[1;30;43mtitle\033[0m: The tile of $1\n" echo -ne "#########################################\n" echo -ne "\n" echo -ne "### input your \033[1;30;43mtitle\033[0m:" read title echo -ne "title: $title\n" echo -ne "\n" echo -ne "#########################################\n" echo -ne "# \033[1;30;43mkeywords\033[0m: GNU, linux, unix\n" echo -ne "#########################################\n" echo -ne "\n" echo -ne "### input your \033[1;30;43mkeywords\033[0m:" read keywords echo -ne "keywords: $keywords\n" echo -ne "\n" echo -ne "#########################################\n" echo -ne "# \033[1;30;43mdescription\033[0m: The description of $1\n" echo -ne "#########################################\n" echo -ne "\n" echo -ne "### input your \033[1;30;43mdescription\033[0m:" read description echo -ne "description: $description\n" echo -ne "\n" echo -ne "#########################################\n" echo -ne "# \033[1;30;43mheading\033[0m: The heading of $1\n" echo -ne "#########################################\n" echo -ne "\n" echo -ne "### input your \033[1;30;43mheading\033[0m:" read heading echo -ne "heading: $heading\n" echo -ne "\n" echo -ne "#########################################\n" echo -ne "# \033[1;30;43mdate\033[0m: Created date of $1\n" echo -ne "#########################################\n" echo -ne "\n" date=`date` echo -ne "date: $date\n" touch $1 cat << EOF >> $1
>
$date