You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
427 B
23 lines
427 B
#!/bin/bash
|
|
if [ $# -eq 0 ]; then
|
|
echo "No arguments supplied"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$1" != *.flf ]]; then
|
|
echo "Are you sure you supplied FIGlet font file?"
|
|
exit 1
|
|
fi
|
|
|
|
f=`basename "$1"`
|
|
output="${f%.flf}.sh"
|
|
|
|
if [ -f $output ]; then
|
|
echo "File $output already exists. Aborting."
|
|
exit 1
|
|
fi
|
|
|
|
awk -f figlet.awk $1 > $output
|
|
cat prettyPrintSnippet.sh >> $output
|
|
chmod +x $output
|
|
echo "Successfuly written to file $output"
|
|
|