mirror of
https://github.com/hamishcoleman/thinkpad-ec
synced 2024-11-04 06:00:12 +00:00
24 lines
419 B
Bash
Executable File
24 lines
419 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
|
|
|
|
if ! LINE=$(grep -E "^$FILE " "$DESCRIPTIONS"); then
|
|
echo "Unknown file $FILE"
|
|
exit 1
|
|
fi
|
|
|
|
echo "$LINE" | perl -pe 's/^(\S+)\s+(\S+)\s+//'
|
|
|