eolas/neuron/d51b0102-d73a-44e4-ad82-a3be740837e0/Bash_colour_output.md
2025-03-27 17:56:31 +00:00

24 lines
363 B
Markdown

---
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.