#!/bin/bash # # Author: Martin Schneider # Copyright (c) Actiware Development GmbH function getUserInput() { read -p "$1" USER_INPUT while [ -z "$USER_INPUT" ] || [ "$USER_INPUT" = "NA" ] do echo "Keine Eingabe erfasst. Bitte versuchen Sie es erneut." >&2 read -p "$1" USER_INPUT done echo $USER_INPUT } # println echos string function println() { echo -e "$1" } # errorln echos i red color function errorln() { println "${C_RED}${1}${C_RESET}" } # successln echos in green color function successln() { println "${C_GREEN}${1}${C_RESET}" } # infoln echos in blue color function infoln() { println "${C_BLUE}${1}${C_RESET}" } # warnln echos in yellow color function warnln() { println "${C_YELLOW}${1}${C_RESET}" } # fatalln echos in red color and exits with fail status function fatalln() { errorln "$1" exit 1 } export -f errorln export -f successln export -f infoln export -f warnln