Skip to content

Instantly share code, notes, and snippets.

@benrowe
Created February 9, 2016 23:08
Show Gist options
  • Save benrowe/88b3974e98f77f3b435a to your computer and use it in GitHub Desktop.
Save benrowe/88b3974e98f77f3b435a to your computer and use it in GitHub Desktop.
common bash functionality for echo'ing
#!/bin/bash
# text colours
text_error='\033[0;31m'
text_success='\033[0;32m'
text_warning='\033[0;33m'
text_info='\033[0;34m'
text_default='\033[0m'
function e() {
string=$1
color=$2
colorvar="text_${color}"
echo -e "${!colorvar}$string$text_default"
}
function pause() {
prompt=$1
echo -e -n "\033[1;36m$prompt"
echo -e -n '\033[0m'
read
clear
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment