-
- # Put charfile into table
- column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator ' | '
- read INPUT
-
- # Navigate to the right characther
- OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
+ # Put charfile into table, showing only the shortcuts below the divider in the charfile
+ cat $CHARFILE | grep -A 100 - | tail -n +2 | column -t --output-separator ' | ' --separator ','
+
+ # Automatically enter input
+ read -N $LENGTH INPUT
+
+ # This can definately be simplifed, but it works fine
+ LINENUMBER=$(cut -f 1 -d ',' -s $CHARFILE | grep -wn $INPUT | cut -d : -f 1)
+ OUTPUT=$(cut -f 2 -d ',' -s $CHARFILE | head -$LINENUMBER | tail +$LINENUMBER)