eolas/neuron/d01ec7d6-3cb6-49cf-8ad7-eac41eb5b055/Bash_colour_output.md

25 lines
363 B
Bash
Raw Normal View History

2024-12-09 18:34:15 +00:00
---
tags: [shell]
created: Sunday, November 17, 2024
---
# Bash colour output
Define colours:
```bash
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NO_COLOR='\033[0m'
```
Interpolate in string:
```bash
echo -e "${BLUE}INFO Uploading graph file...${NO_COLOR}"
```
Note: must end with the blank colour otherwise everything subsequent will be in
blue.