( Nyizsa | 2022. 01. 23., v – 17:20 )

Szerintem neked egy egyszerű case kell.

#!/bin/bash
# Colorize the bash prompt based on which user is currently logged in.
# For this to work, the - prompt="myPromptx" - must be present in the user's .bashrc file.
# If not present, or #comment then set default myPrompt1 example.
# 
# complett rewrite 2022 - made by csablak
# tested Mageia 8

# foreground color
#Black="\e[30m"
Red="\e[91m"
Green="\e[92m"
Yellow="\e[93m"
#Blue="\e[94m"
#Magenta="\e[95m"	
Cyan="\e[96m"
White="\e[97m"
NC="\e[0m"

case $prompt in

Myprompt1)
# színezés

Myprompt2)
# színezés

...

*)
# default prompt

esac