User Tools

Differences

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

Link to this comparison view

bash_coloration [2016/03/04 11:52] – created ssm2017bash_coloration [2017/01/31 11:31] (current) – ssm2017
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