2008-12-29 22:55:40 +00:00
|
|
|
#!/bin/bash
|
2008-08-12 09:39:03 +00:00
|
|
|
|
|
|
|
# Verzeichnis muss eventuell an den Ort der Compose angepasst werden:
|
|
|
|
COMPOSE=/usr/share/X11/locale/en_US.UTF-8/Compose
|
2008-08-12 11:13:24 +00:00
|
|
|
KEYSYM=/usr/include/X11/keysymdef.h
|
2008-08-12 09:39:03 +00:00
|
|
|
n=10
|
2008-08-12 11:13:24 +00:00
|
|
|
typeset -i j=0
|
2008-08-12 09:39:03 +00:00
|
|
|
|
|
|
|
while [ ! "$beschreibung" ]
|
|
|
|
do
|
|
|
|
case ${1-" "} in
|
2008-08-12 11:13:24 +00:00
|
|
|
" ")
|
|
|
|
echo Aufruf: $0 [OPTION] BESCHREIBUNG
|
|
|
|
echo »$0 --help« gibt Ihnen mehr Informationen.
|
|
|
|
exit;;
|
|
|
|
--help)
|
|
|
|
echo Aufruf: $0 [OPTION] BESCHREIBUNG
|
2008-12-29 22:55:40 +00:00
|
|
|
echo »$0« versucht ein Zeichen anhand einer Beschreibung zu identifizieren
|
2008-08-12 11:13:24 +00:00
|
|
|
echo Option:
|
2009-01-10 12:07:36 +00:00
|
|
|
echo -e " -n gibt maximal 2n statt 10 Vorschläge aus"
|
2008-08-12 11:13:24 +00:00
|
|
|
exit;;
|
|
|
|
\ )
|
|
|
|
echo $0: Kein Suchkriterium eingegeben!
|
|
|
|
echo Versuchen Sie »$0 --help« für weitere Informationen.
|
|
|
|
exit;;
|
|
|
|
-*)
|
|
|
|
n=`echo $1 | cut -c2-`
|
|
|
|
shift;;
|
|
|
|
*)
|
|
|
|
beschreibung=${*?$0: Fehler! Versuchen Sie »$0 --help« für weitere Informationen.}
|
2008-08-12 09:39:03 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
anzahl=`grep -iw $beschreibung $COMPOSE | head -$n | wc -l`
|
|
|
|
if [ $anzahl -gt 0 ]
|
|
|
|
then
|
|
|
|
for i in $(seq 1 $anzahl)
|
|
|
|
do
|
2008-08-12 11:13:24 +00:00
|
|
|
j=j+1
|
2008-08-12 11:22:51 +00:00
|
|
|
ausgabe=1
|
2008-08-12 11:13:24 +00:00
|
|
|
a[$j]=`grep -iw $beschreibung $COMPOSE | grep ^\< | head -$i | tail -1 | cut -f2 -d \"`
|
|
|
|
echo $j\) ${a[$j]}
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
anzahl2=`grep -i [\ _]$beschreibung[\ _] $KEYSYM | head -$n | wc -l`
|
|
|
|
if [ $anzahl2 -gt 0 ]
|
|
|
|
then
|
|
|
|
for i in $(seq 1 $anzahl2)
|
|
|
|
do
|
|
|
|
c=`grep -i [\ _]$beschreibung[\ _] $KEYSYM | grep ^#define | head -$i | tail -1 | cut -f2- -d\* | cut -f2- -d+ | cut -f1 -d\ `
|
|
|
|
c1=`echo $c | cut -c1-2`
|
|
|
|
c2=`echo $c | cut -c3`
|
|
|
|
c3=`echo $c | cut -c4`
|
|
|
|
|
|
|
|
case $c1 in
|
|
|
|
00)
|
|
|
|
j=j+1
|
2008-08-12 11:22:51 +00:00
|
|
|
ausgabe=1
|
2009-01-10 12:07:36 +00:00
|
|
|
a[$j]=`echo -e \\\x${c2}`
|
2008-08-12 11:13:24 +00:00
|
|
|
echo $j\) ${a[$j]}
|
|
|
|
;;
|
|
|
|
03)
|
|
|
|
if [ "$c2" = "C" ]
|
|
|
|
then
|
|
|
|
j=j+1
|
2008-08-12 11:22:51 +00:00
|
|
|
ausgabe=1
|
2009-01-10 12:07:36 +00:00
|
|
|
a[$j]=`echo -e \\\xcf\\\x8${c3}`
|
2008-08-12 11:13:24 +00:00
|
|
|
echo $j\) ${a[$j]}
|
|
|
|
|
|
|
|
else
|
|
|
|
j=j+1
|
2008-08-12 11:22:51 +00:00
|
|
|
ausgabe=1
|
2009-01-10 12:07:36 +00:00
|
|
|
a[$j]=`echo -e \\\xce\\\x${c2}${c3}`
|
2008-08-12 11:13:24 +00:00
|
|
|
echo $j\) ${a[$j]}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2008-08-12 09:39:03 +00:00
|
|
|
done
|
2008-08-12 11:13:24 +00:00
|
|
|
fi
|
2008-08-12 09:39:03 +00:00
|
|
|
|
2008-08-12 11:13:24 +00:00
|
|
|
if [ $ausgabe ]
|
|
|
|
then
|
2008-08-12 09:39:03 +00:00
|
|
|
read -p 'welches Zeichen suchen Sie: ' zahl
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo „$beschreibung“ ist unbekannt, versuchen Sie eine andere Beschreibung.
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${a[$zahl]} ]
|
|
|
|
then
|
2008-08-12 19:02:16 +00:00
|
|
|
wiemitneo ${a[$zahl]}
|
2008-08-12 09:39:03 +00:00
|
|
|
fi
|