--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- Text2HTML ------------------------- Die Aug 28 16:59:21 MEST 2001 ------------------------- Text HTML Convert Text2HTML text2html text Konvertierung sed Skript Shell Shell-Skript ----------------------------------------------------------------------------- Sie wollen Text in HTML konvertieren. Dieser Artikel stellt text2html vor. ----------------------------------------------------------------------------- Das Skript, siehe <"down/text2html.sh">Download: --------CODE--------: text2html.sh #!/bin/bash # text2html - Converts text in html # - Kovertiert text in html # Copyright (C) Die Aug 28 17:01:01 MEST 2001 by Ingo Blechschmidt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # if [ "$1" = "" ]; then echo "Usage: text2html [metas], try $0 --help"; exit 1; fi if [ "$1" = "--help" -o "$1" = "-h" ]; then if echo "$LC_ALL" | grep DE > /dev/null || echo "$LANG" | grep DE > /dev/null; then echo "Benutzung: text2html 'titel' 'mail' 'autor' 'beschreibung' 'stichworte' 'robots' 'copyright' 'datum' text2html liest von STDIN und schreibt nach STDOUT. Die Parameter sind selbst-erklärend, jeder Parameter muss gesetzt werden. Benutzen Sie '' für den Standardwert. Für's Datum versuchen Sie \`date\`." else echo "Usage: text2html 'title' 'mail' 'author' 'desc' 'keywords' 'robots' 'copyright' 'date' text2html reads from the standard input and writes to the standard output. The parameters are self explanetory, every parameter has to be set. Use '' if you don't want to set a meta. For date try \`date\`." fi exit 0; fi TITLE="$1"; MAIL="$2"; AUTHOR="$3"; DESC="$4"; KEY="$5"; ROBS="$6"; CP="$7"; DATE="$8" DATE=`date -d "$(echo $DATE | gawk '{ print $2, $3, $4, $5; }')" '+%Y-%m-%dT%H:%M:%S+02:00'` cat < $TITLE

$TITLE




`sed -e 's/"/\"/g' -e 's//\>/g' \ -e 's/ä/\ä/g' -e 's/ü/\ü/g' -e 's/ö/\ö/g' \ -e 's/Ä/\Ä/g' -e 's/Ü/\Ü/g' -e 's/Ö/\Ö/g' \ -e 's/ß/\ß/'`

EOHM --------/CODE-------- Die Bedienung: Benutzung: text2html 'titel' 'mail' 'autor' 'beschreibung' 'stichworte' 'robots' 'copyright' 'datum' text2html liest von STDIN und schreibt nach STDOUT. Die Parameter sind selbst-erklärend, jeder Parameter muss gesetzt werden. Benutzen Sie '' für den Standardwert. Für's Datum versuchen Sie `date`. Alle Skripts auf meiner Website habe ich mit diesem Tool konvertiert. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This document is distributed under the terms of the GNU Free Documentation License.