aboutsummaryrefslogtreecommitdiffstats
path: root/showfigfonts
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-05-08 14:52:11 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2012-05-08 14:52:11 +0100
commit017f336a5121897cd64179e84ded15e1dd37bd92 (patch)
tree2ae42241ba854d6c7726ad857195d0f5edafa053 /showfigfonts
parentdee0cd250574b52e74a9390f6f9c1efd818223d4 (diff)
parent8fdab96d486ba52601544c67c38625480ddf7640 (diff)
downloadfiglet-017f336a5121897cd64179e84ded15e1dd37bd92.tar.gz
Merge tag 'upstream/2.2.4'
Upstream version 2.2.4
Diffstat (limited to 'showfigfonts')
-rwxr-xr-xshowfigfonts23
1 files changed, 9 insertions, 14 deletions
diff --git a/showfigfonts b/showfigfonts
index 643c60b..90c4d0a 100755
--- a/showfigfonts
+++ b/showfigfonts
@@ -10,14 +10,11 @@
#
# Usage: showfigfonts [ -d directory ] [ word ]
-# Set up PATH so figlet can be found
-DIRSAVE=`pwd`
-cd `dirname "$0"`
-PATH="$PATH":`pwd`
-cd "$DIRSAVE"
+DIR=`dirname $0`
+FIGLET=$DIR/figlet
# Get figlet version
-FIGLETVERSION=`figlet -I1 2>/dev/null`
+FIGLETVERSION=`$FIGLET -I1 2>/dev/null`
if [ -z "$FIGLETVERSION" ]; then
FIGLETVERSION=20000
fi
@@ -39,22 +36,20 @@ else
fi
if [ "$FIGLETVERSION" -lt 20100 ]; then
# figlet 2.0
- FONTDIR="`figlet -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`"
+ FONTDIR="`$FIGLET -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`"
else
# figlet 2.1 or later
- FONTDIR="`figlet -I2`"
+ FONTDIR="`$FIGLET -I2`"
fi
fi
-cd "$FONTDIR"
-FONTLIST=`ls *.flf | sed s/\.flf$//`
-cd $DIRSAVE
+FONTLIST=`ls "$FONTDIR"/*.flf | sed 's!.*/\(.*\)\.flf$!\1!'`
for F in $FONTLIST ; do
- echo "$F" :
+ echo "$F :"
if [ -n "$WORD" ]; then
- echo "$WORD" | figlet -d "$FONTDIR" -f "$F"
+ echo "$WORD" | $FIGLET -d "$FONTDIR" -f "$F"
else
- echo "$F" | figlet -d "$FONTDIR" -f "$F"
+ echo "$F" | $FIGLET -d "$FONTDIR" -f "$F"
fi
echo "" ; echo ""
done