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 ?

0

1 Answer 1

1

Just change:

echo -e $line

With:

eval echo -e \"$line\"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.