Skip to content

Instantly share code, notes, and snippets.

@fjrti
Last active January 25, 2024 11:20
Show Gist options
  • Save fjrti/0e75ff0c1e0dae722324727c425c569b to your computer and use it in GitHub Desktop.
Save fjrti/0e75ff0c1e0dae722324727c425c569b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Set the color variable
green='\033[0;32m'
# Clear the color after that
clear='\033[0m'
printf "The script was executed ${green}successfully${clear}!"
#!/bin/bash
# Color variables
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
# Clear the color after that
clear='\033[0m'
# Examples
echo -e "The color is: ${red}red${clear}!"
echo -e "The color is: ${green}green${clear}!"
echo -e "The color is: ${yellow}yellow${clear}!"
echo -e "The color is: ${blue}blue${clear}!"
echo -e "The color is: ${magenta}magenta${clear}!"
echo -e "The color is: ${cyan}cyan${clear}!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment