See below an example script to display a SUCCESS message in green or a FAILED message in red, right-aligned at the end of the line.
#!/bin/bash # Set the message success_message="Your command was successful" failed_message="Your command failed" # Set the "OK" string in green ok="$(tput setaf 2)[SUCCES]$(tput sgr0)" failed="$(tput setaf 1)[FAILED]$(tput sgr0)" # Get the width of the terminal term_width=$(tput cols)+9 # Calculate the number of dots needed...
ing. M.A.C.M. (Martijn) van den BoomComputer Infrastructure Engineeringenieur, docent en mentor
