Skip to content

Instantly share code, notes, and snippets.

@Virtlink
Last active April 6, 2026 11:58
Show Gist options
  • Select an option

  • Save Virtlink/e3f92718a5fff4e6391a69a38198b4cc to your computer and use it in GitHub Desktop.

Select an option

Save Virtlink/e3f92718a5fff4e6391a69a38198b4cc to your computer and use it in GitHub Desktop.
Shell script template
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o noclobber
set -o nounset
#set -o xtrace #debug
# Colors and formatting
NC=$(tput sgr0)
BOLD=$(tput bold)
DIM=$(tput dim)
ITALIC=$(tput sitm)
ULINE=$(tput smul)
BLINK=$(tput blink)
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
INFO="${BLUE}ℹ${NC}"
OK="${GREEN}✓${NC}"
WARN="${YELLOW}⚠${NC}"
ERROR="${RED}✖${NC}"
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment