Skip to content
Snippets Groups Projects

Version 2

Merged Hahn Axel (hahn) requested to merge version-2 into master
1 file
+ 14
2
Compare changes
  • Side-by-side
  • Inline
+ 26
3
@@ -6,7 +6,9 @@
typeset -i rc=0
# Fetch returncode of last executed command.
# It summarizes all exitcodes into rc (= if any job failed it is <> 0)
# It stores the last exitcode in myrc
function fetchrc(){
myrc=$?
echo rc=$myrc
@@ -21,6 +23,9 @@ function fetchrc(){
# ------------------------------------------------------------
# color text
# ------------------------------------------------------------
# set a terminal color by a keyword
# param string keyword to set a color; one of reset | head|cmd|input | ok|warning|error
function color(){
sColorcode=""
case $1 in
@@ -34,6 +39,8 @@ function fetchrc(){
;;
"ok") sColorcode="92" # green
;;
"warning") sColorcode="33" # yellow
;;
"error") sColorcode="91" # red
;;
esac
@@ -42,6 +49,12 @@ function fetchrc(){
fi
}
function showPrompt(){
color input
echo -n "$*"
color reset
}
# ----------------------------------------------------------------------
# headlines
# ----------------------------------------------------------------------
@@ -49,7 +62,8 @@ function fetchrc(){
function h1(){
color head
echo
echo "====== $* ======"
echo
echo "########## $* ##########"
echo
color reset
}
@@ -57,7 +71,16 @@ function fetchrc(){
function h2(){
color head
echo "--- $*"
echo
echo "========== $* =========="
echo
color reset
}
function h3(){
color head
echo
echo "---------- $*"
color reset
}
Loading