From: Michael Prokop Date: Thu, 8 Feb 2007 18:22:16 +0000 (+0100) Subject: add grml-tips2html.sh, thanks nico X-Git-Tag: 0.3-18~1 X-Git-Url: http://git.grml.org/?p=grml-tips.git;a=commitdiff_plain;h=3c088b46c42b4470aac4a3d78c0557f54ccba736 add grml-tips2html.sh, thanks nico --- diff --git a/grml_tips b/grml_tips index e044aaf..e5ad0da 100644 --- a/grml_tips +++ b/grml_tips @@ -413,13 +413,17 @@ Test sound: Improved grep version: % glark +-- +Grep with highlighting: -glark grep extract-matches +% grep --color=auto ... +% hgrep ... -- -Highlith +Extract matches when grepping: -grepc -hgrep +Usage examples: +% ifconfig | grepc 'inet addr:(.*?)\s' +% ifconfig | glark --extract-matches 'inet addr:(.*?)\s' -- Output text as sound: diff --git a/html/Makefile b/html/Makefile new file mode 100644 index 0000000..cd09f85 --- /dev/null +++ b/html/Makefile @@ -0,0 +1,11 @@ +all: html online + +html: + cp ../grml_tips grml_tips + ./grml-tips2html.sh + +online: html + scp grml_tips.html grml:/var/www/grml/tips/index.html + +clean: + rm grml_tips grml_tips.html grml_tips.orig diff --git a/html/grml-tips2html.sh b/html/grml-tips2html.sh new file mode 100755 index 0000000..87a1847 --- /dev/null +++ b/html/grml-tips2html.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +OUTFILE=grml_tips.html +INFILE=grml_tips +count=0 + +cp grml_tips grml_tips.orig +cp grml_tips grml_tips.sed +sed -i 's/>/\>/' grml_tips.sed +sed -i 's/ grml_tips.html +cat >> $OUTFILE << EOF + + +grml.org - grml Tips + + + + + + + + + + + + + + + + + + + + + + +EOF + +echo "" >> $OUTFILE +echo "
" >> $OUTFILE
+oifs=$IFS
+IFS=''
+while read LINE
+do  
+    case $LINE in
+        --\ *)
+          count=$(($count + 1))
+          LINE="
${LINE#-- }" + echo "
" >> $OUTFILE + echo $LINE >> $OUTFILE + echo "
" >> $OUTFILE
+          ;;
+        *)
+          echo $LINE >> $OUTFILE
+          ;;
+    esac
+done < $INFILE
+IFS=$oifs
+
+cat >> $OUTFILE << EOF
+
+
+
+EOF