Use: message "Informing you about something"
message () {
printf "\n";
printf "\e[30;48;5;82m ${1} \e[0m "
printf "\n";
}
WORKING_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)";
use: split_string "string,to split" ,
- the comma here is the separator. Also see man cut
split_string() {
echo "$1" | cut -d"$2" -f1;
}
use: upper_case_word "sasha"
upper_case_word() {
word=${1}
therest=$(tr '[a-z]' '[A-Z]'<<<"${word:0:1}")
echo "${therest}${word:1}"
}
cat << 'MyHeredoc' >> ./OUTPUT_FILENAME
#!/bin/bash
var1="var1value"
var2="var2value"
MyHeredoc