User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
bash_coloration [2016/03/04 11:52] – created ssm2017bash_coloration [2022/02/07 13:29] (current) – external edit 127.0.0.1
Line 30: Line 30:
  
 echo -e "${ColGreenF}Here is a green text.${ColReset}" echo -e "${ColGreenF}Here is a green text.${ColReset}"
 +</sxh>
 +Another version compatible with "read" :
 +<sxh bash>
 +ColRedF=$'\e[31m';
 +ColReset=$'\e[0m';
 +read -p "${ColRedF}Foobar${ColReset}:" foobar
 +echo -e ${ColRedF}Foobar${ColReset}"
 </sxh> </sxh>
 {{tag>bash}} {{tag>bash}}

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information