#!/bin/bash
#===============================================================================
#
#          FILE: asciiart
#
#         USAGE: asciiart <String>
#
#   DESCRIPTION: Print string in ASCII-art
#
#       OPTIONS: <String>
#
#  REQUIREMENTS: asciiart_chars
#
#          BUGS:  ---
#        AUTHOR: rickz (Rick Zhang), xlrickz@gmail.com
#       COMPANY: X-LEGEND Entertainment Corp.
#       CREATED: Tue Sep 20 05:19:45 EDT 2011
#      REVISION: 1.0
#
#          TODO:
#
#===============================================================================

#set -o nounset                              # Treat unset variables as an error
#set -m                                       # Enable job control

[ "$1" == "" ] && exec echo "Usage: $0 <String>"

(echo -n 'paste -d "" '
 for CHAR in $(sed 's/\(.\)/\1 /g' <<< "$1");do 
    echo -n "<(sed -n '/^#$CHAR$/,/^$/p' ~/bin/asciiart_chars|egrep -v '^#.$|^$') "
 done 
) > /tmp/asciiart_cmdline

source /tmp/asciiart_cmdline

rm -f /tmp/asciiart_cmdline
