#--- Function to display a word ($1) and fill the rest with spaces #--- until the length of the word is according to parameter $2 #--- Character Color according to $3 #--- Background Color according to $4 #--- Syntax: eg. show SSH 8 ROT GELBE-H #--- Would display the word SSH in red on yellow #--- and add 5 spaces at the end of it.(8-3=5) #--- To display multiple words, enclose them in single qiotes: #--- eg. show 'I have many words here' 26 ROT GELBE-H #--- Result: The Phrase would be 26 char long, written in red on yellow background show () { #--------Effekte: FETT="\\033[1m" UNTERSTRICHT="\\033[4m" FLACKER="\\033[5m" UNSICHBAR="\\033[8m" #--------Schrift Farbe: ROT="\\033[31m" GRUEN="\\033[32m" GELB="\\033[33m" BLAU="\\033[34m" VIOLET="\\033[35m" HELLBLAU="\\033[36m" WEISS="\\033[37m" SCHWARTZ="\\033[39m" #---------Hintergrund Farbe: SCHWARTZ_H="\\033[40m" ROT_H="\\033[41m" GRUEN_H="\\033[42m" GELB_H="\\033[43m" BLAU_H="\\033[44m" VIOLET_H="\\033[45m" HELLBLAU_H="\\033[46m" WEISS_H="\\033[47m" NORMALE="\\033[m" REVERSE="\\033[7m" #------- Erase the possible spaces at the beginning or the end of the word word=$(echo -n $1 | sed -e 's/^ *//g' -e 's/ *$//g') ; spaces=" "; let sp=$2-$(echo -n $word | wc -m); echo -ne $(eval echo \$$3)$(eval echo \$$4)$word$NORMAL$(echo -n $spaces | cut -b $sp) } ##### Example show 'test eee' 12 GRUEN GELB_H read a