Changeset 752

Show
Ignore:
Timestamp:
08/12/08 13:13:24 (5 years ago)
Author:
pascal
Message:

wenigstens die griechischen Buchstaben sollten gehen

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • linux/bin/beschreibe

    r751 r752  
    33# Verzeichnis muss eventuell an den Ort der Compose angepasst werden: 
    44COMPOSE=/usr/share/X11/locale/en_US.UTF-8/Compose 
     5KEYSYM=/usr/include/X11/keysymdef.h 
    56n=10 
     7typeset -i j=0 
    68 
    79while [ ! "$beschreibung" ] 
    810do 
    911        case ${1-" "} in 
    10                 " ") 
    11                         echo Aufruf: $0 [OPTION] BESCHREIBUNG 
    12                         echo »$0 --help« gibt Ihnen mehr Informationen. 
    13                         exit;; 
    14                 --help) 
    15                         echo Aufruf: $0 [OPTION] BESCHREIBUNG 
    16                         echo »$0« versucht ein Zeichen anhand einer Beschreibung zu idetifizieren 
    17                         echo Option: 
    18                         echo -e "  -n               gibt n statt 10 Vorschläge aus" 
    19                         exit;; 
    20                 \ ) 
    21                         echo $0: Kein Suchkriterium eingegeben! 
    22                         echo Versuchen Sie »$0 --help« für weitere Informationen. 
    23                         exit;; 
    24                 -*) 
    25                         n=`echo $1 | cut -c2-` 
    26                         shift;; 
    27                 *) 
    28                         beschreibung=${*?$0: Fehler! Versuchen Sie »$0 --help« für weitere Informationen.} 
     12        " ") 
     13                echo Aufruf: $0 [OPTION] BESCHREIBUNG 
     14                echo »$0 --help« gibt Ihnen mehr Informationen. 
     15                exit;; 
     16        --help) 
     17                echo Aufruf: $0 [OPTION] BESCHREIBUNG 
     18                echo »$0« versucht ein Zeichen anhand einer Beschreibung zu idetifizieren 
     19                echo Option: 
     20                echo -e "  -n               gibt n statt 10 Vorschläge aus" 
     21                exit;; 
     22        \ ) 
     23                echo $0: Kein Suchkriterium eingegeben! 
     24                echo Versuchen Sie »$0 --help« für weitere Informationen. 
     25                exit;; 
     26        -*) 
     27                n=`echo $1 | cut -c2-` 
     28                shift;; 
     29        *) 
     30                beschreibung=${*?$0: Fehler! Versuchen Sie »$0 --help« für weitere Informationen.} 
    2931        esac 
    3032done 
     
    3335if [ $anzahl -gt 0 ] 
    3436then 
     37        ausgabe=1 
    3538        for i in $(seq 1 $anzahl) 
    3639        do 
    37                 a[$i]=`grep -iw $beschreibung $COMPOSE | grep ^\< | head -$i | tail -1 | cut -f2 -d \"` 
    38                 echo $i\) ${a[$i]} 
     40                j=j+1 
     41                a[$j]=`grep -iw $beschreibung $COMPOSE | grep ^\< | head -$i | tail -1 | cut -f2 -d \"` 
     42                echo $j\) ${a[$j]} 
    3943        done 
     44fi 
    4045 
     46anzahl2=`grep -i [\ _]$beschreibung[\ _] $KEYSYM | head -$n | wc -l` 
     47if [ $anzahl2 -gt 0 ] 
     48then 
     49        ausgabe=1 
     50        for i in $(seq 1 $anzahl2) 
     51        do 
     52                c=`grep -i [\ _]$beschreibung[\ _] $KEYSYM | grep ^#define  | head -$i | tail -1 | cut -f2- -d\* | cut -f2- -d+ | cut -f1 -d\ ` 
     53                c1=`echo $c | cut -c1-2` 
     54                c2=`echo $c | cut -c3` 
     55                c3=`echo $c | cut -c4` 
     56 
     57                case $c1 in 
     58                00) 
     59                        j=j+1 
     60                        a[$j]=`echo -e \\\x${c2}` 
     61                        echo $j\) ${a[$j]} 
     62                        ;; 
     63                03)      
     64                        if [ "$c2" = "C" ] 
     65                        then 
     66                                j=j+1 
     67                                a[$j]=`echo -e \\\xcf\\\x8${c3}` 
     68                                echo $j\) ${a[$j]} 
     69 
     70                        else 
     71                                j=j+1 
     72                                a[$j]=`echo -e \\\xce\\\x${c2}${c3}` 
     73                                echo $j\) ${a[$j]} 
     74                        fi 
     75                        ;; 
     76                *) 
     77                        ;; 
     78                esac     
     79        done 
     80fi 
     81 
     82if [ $ausgabe ] 
     83then 
    4184        read -p 'welches Zeichen suchen Sie: ' zahl 
    4285        echo 
     
    4891if [ ${a[$zahl]} ] 
    4992then 
    50         echo 
    5193        ./wiemitneo ${a[$zahl]} 
    5294fi