#!/bin/sh # # convhtml : .txt to .html converter. # # June 19, 1998 # Ilker Ficicilar - filker@mailexcite.com # # usage: for a file ending with the ".txt" extension: # convhtml file_name # # it will output a file named file_name.html # # if [ "$1" != "" ] then if test -f $1.txt then nm=$1 cat $1.txt | sort | tail -30 | wc | while read dg do set $dg satir=`expr $3 / $1` set $nm echo "" "" " " > $1.html echo >> $1.html # # ">" ve "<" karakterlerini donusturerek yaziyi oku/tara. # cat $1.txt | sed "s/>/\>/g" | sed "s/" # # bu er degiskeni, programin ileriki surumlerinde gerekebilir. # simdilik durmasinda bir sakinca yok. # er=kisa else echo "$qw" er=uzun fi done else echo "

" fi done >> $1.html echo >> $1.html # # evet isimiz bitti # echo "" >> $1.html done else echo echo " $1.txt diye bir dosya yok." echo "lutfen sadece convhtml yazarak yardim alin." echo fi else echo echo "convhtml : .txt uzantili dosyalari .html bicimine cevirme." echo echo 19 Haziran 1998 echo "Ilker Ficicilar - filker@mailexcite.com" echo echo kullanimi echo --------- echo echo " Sonu .txt ile biten dosya_adi.txt gibi bir dosyayi," echo "convhtml dosya_adi seklinde \".txt\" uzantisini yazmaksizin calistiririz." echo echo "Program, dosya_adi.html isminde bir HTML dosyasi olusturacaktir." echo fi # Asagida bir yazi dosyasinin satirlarinin uzun mu kisa mi oldugunu #saptayan program parcasini bulabilirsiniz. # ##!/bin/sh #cat $1.txt | while read qw #do #echo $qw | wc -c | while read we #do #if [ "$we" -lt 60 ] #then #echo kisa #else #echo uzun #fi #done #done