thinkpad-ec/scripts/describe

26 lines
429 B
Bash
Executable File

#!/bin/sh
#
# Look up the given filename in the description file and output the
# text description
#
# FIXME
# - the description file is expected to be in the current dir
DESCRIPTIONS=Descriptions.txt
FILE="$1"
if [ -z "$1" ]; then
echo need filename
exit 1
fi
LINE=$(egrep "^$FILE " "$DESCRIPTIONS")
if [ $? -ne 0 ]; then
echo "Unknown file $FILE"
exit 1
fi
echo "$LINE" | perl -pe 's/^(\S+)\s+(\S+)\s+//'