BigBug

Linux Stuff

BASH Commands
BASH colors
BASH Misc
What To Install

#!/bin/bash

# day of week (1..7); 1 is Monday
erdetFredag=$(date +%u)

ColStd='\e[1;37m'
ColRed='\e[1;31m'
ColGreen='\e[0;32m'
NOCOLOR='\e[0m'

printf "\n${ColStd}Er det fredag?${NOCOLOR}\n\n"

if [ "$erdetFredag" = "5" ]; then
    printf "     ${ColGreen}Ja${NOCOLOR}"
else
    printf "     ${ColRed}Nej${NOCOLOR}"
fi
printf "\n\n"

Hide/show cursor/caret in terminal

#!/bin/bash

tput civis #hide caret
printf "1"
sleep 1
printf "\r"
printf "2"
sleep 1
printf "\r"
printf "3"
printf "\n"
tput cnorm #show caret