#!/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"