2

I have a file with this line for example :

${blue}*Passed*${NC}: check the command line ...

I can read in bash this line :

red='\e[41m'
blue='\e[1;34m'
purple='\e[1;31m'
NC='\e[0m' # No Color

 while read line
 do
      echo -e $line
 done < test_contest

But the output is like this :

${blue}Passed${NC}: check the command line ...

there is no color, can bash interpret this line to output color ?

mpgn
  • 6,973
  • 9
  • 66
  • 100

1 Answers1

1

Just change:

echo -e $line

With:

eval echo -e \"$line\"
whoan
  • 7,761
  • 4
  • 37
  • 47