Skip to content

Instantly share code, notes, and snippets.

View LiviuLvu's full-sized avatar

Liviu Iancu LiviuLvu

View GitHub Profile
@LiviuLvu
LiviuLvu / colorize_out.sh
Last active August 23, 2024 16:42
Colorize output of disk usage comand using awk
#!/bin/bash
set -euo pipefail
# Assign default values if user does not provide parameters
high_default=${1:-80}
med_default=${2:-50}
printf "Colorize lines for disk usage \n"
printf "How to use: ./file_name.sh <high_value> <medium_value>. Order high to med is important for correct coloring. Example command: \n"
printf "./colorize_out.sh 90 60 \n\n"