#!/bin/bash # Needed to use aliases shopt -s expand_aliases # Initialize the arrays COLORS=(fake bla red gre yel blu pin cya whi) FONTS=(fake bol und bli rev hid) FG_COLOR_CODES=(00 30 31 32 33 34 35 36 37) BG_COLOR_CODES=(00 40 41 42 43 44 45 46 47) FONT_CODES=(0 1 4 5 7 8) ### Font, Foreground and Background # Loop Initializers FG_CODE_LOOP="0" BG_CODE_LOOP="0" FONT_CODE_LOOP="0" # Set FG from all the pretty colors for FG in "${COLORS[@]}" do # Set BG from all the pretty colors for BG in "${COLORS[@]}" do # Set Code from all the flashy fonts for FONT in "${FONTS[@]}" do # Checking for Fake foreground if [ "$FG" == "fake" ] then FGD="" FG_CODE="" else FGD="f$FG" FG_CODE=";"${FG_COLOR_CODES[$FG_CODE_LOOP]} fi # Checking for Fake background if [ "$BG" == "fake" ] then BGD="" BG_CODE="" else BGD="b$BG" BG_CODE=";"${BG_COLOR_CODES[$BG_CODE_LOOP]} fi # Checking for Fake font if [ "$FONT" == "fake" ] then FND="" FONT_CODE="" else FND="$FONT" FONT_CODE=${FONT_CODES[$FONT_CODE_LOOP]} fi # Check for all nulls if [ "$FND" == "" ] && [ "$FGD" == "" ] && [ "$BGD" == "" ] then # All the work, none of the benfit! asdlfdsalfj="" else # Need to check and see if the last char is a semi-colon # Finally do the do alias "$FND$FGD$BGD"="GREP_COLOR='$FONT_CODE$FG_CODE$BG_CODE' grep --color=always -E " fi # Increment! FONT_CODE_LOOP=$(($FONT_CODE_LOOP+1)) done # Reset for the next Loop FONT_CODE_LOOP="0" # Increment! BG_CODE_LOOP=$(($BG_CODE_LOOP+1)) done # Reset for the next Loop BG_CODE_LOOP="0" # Increment! FG_CODE_LOOP=$(($FG_CODE_LOOP+1)) done