summaryrefslogtreecommitdiff
path: root/linux/bin
diff options
context:
space:
mode:
Diffstat (limited to 'linux/bin')
-rwxr-xr-xlinux/bin/beschreibe16
1 files changed, 12 insertions, 4 deletions
diff --git a/linux/bin/beschreibe b/linux/bin/beschreibe
index 3b824da..02462a7 100755
--- a/linux/bin/beschreibe
+++ b/linux/bin/beschreibe
@@ -6,6 +6,14 @@ KEYSYM=/usr/include/X11/keysymdef.h
n=10
typeset -i j=0
+if [ "foo`echo -e bar`" = "foobar" ];then
+ # GNU echo
+ ECHO_e="echo -e"
+else
+ # POSIX echo
+ ECHO_e="echo"
+fi
+
while [ ! "$beschreibung" ]
do
case ${1-" "} in
@@ -17,7 +25,7 @@ do
echo Aufruf: $0 [OPTION] BESCHREIBUNG
echo »$0« versucht ein Zeichen anhand einer Beschreibung zu identifizieren
echo Option:
- echo -e " -n gibt maximal 2n statt 10 Vorschläge aus"
+ echo " -n gibt maximal 2n statt 10 Vorschläge aus"
exit;;
\ )
echo $0: Kein Suchkriterium eingegeben!
@@ -57,7 +65,7 @@ then
00)
j=j+1
ausgabe=1
- a[$j]=`echo -e \\\x${c2}`
+ a[$j]=`$ECHO_e \\\x${c2}`
echo $j\) ${a[$j]}
;;
03)
@@ -65,13 +73,13 @@ then
then
j=j+1
ausgabe=1
- a[$j]=`echo -e \\\xcf\\\x8${c3}`
+ a[$j]=`$ECHO_e \\\xcf\\\x8${c3}`
echo $j\) ${a[$j]}
else
j=j+1
ausgabe=1
- a[$j]=`echo -e \\\xce\\\x${c2}${c3}`
+ a[$j]=`$ECHO_e \\\xce\\\x${c2}${c3}`
echo $j\) ${a[$j]}
fi
;;