# Include me for neat color defines! : <<"END_OF_COPYRIGHT" Copyright (c) 2000-2012, CyberLeo All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of the source code must retain the above copyright notice, this list of conditions, and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILTY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_OF_COPYRIGHT if [ -z "${__ansi_sh_loaded}" ] then __ansi_sh_loaded=yes # ANSI formats e="$(printf "\033")" # ANSI styles a_bright="$e[1m" a_dim="$e[2m" a_italic="$e[3m" # Probably won't work a_underline="$e[4m" # Probably won't work a_blink="$e[5m" # Annoying; probably won't work a_flash="$e[6m" # Probably won't work a_inverse="$e[7m" a_conceal="$e[8m" # Probably won't work a_strike="$e[9m" # Probably won't work # ANSI colors a_red="$e[1;31m" a_green="$e[1;32m" a_yellow="$e[1;33m" a_blue="$e[1;34m" a_purple="$e[1;35m" a_cyan="$e[1;36m" a_white="$e[1;37m" a_gloom="$e[1;30m" a_crimson="$e[0;31m" a_forest="$e[0;32m" a_brown="$e[0;33m" a_navy="$e[0;34m" a_violet="$e[0;35m" a_aqua="$e[0;36m" a_gray="$e[0;37m" a_black="$e[0;30m" a_bred="$e[41m" a_bgreen="$e[42m" a_bbrown="$e[43m" a_bblue="$e[44m" a_bpurple="$e[45m" a_bcyan="$e[46m" a_bgray="$e[47m" a_bblack="$e[40m" # Normal is at the bottom, otherwise debugging via 'sh -x' is difficult a_normal="$e[0m" a() { while [ "${1}" ] do eval "echo \${a_$1}" shift done } fi