Skip to content

Instantly share code, notes, and snippets.

@Gen2ly
Created May 31, 2012 15:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save Gen2ly/2844306 to your computer and use it in GitHub Desktop.
Save Gen2ly/2844306 to your computer and use it in GitHub Desktop.
Description of script
#!/bin/bash
# Description of script
# Display usage if no parameters given
if [[ -z "$@" ]]; then
echo " ${0##*/} <input> - description"
exit
fi
# Required program(s)
req_progs=(prog1 prog2)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
# Text color variables
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldblu=${txtbld}$(tput setaf 4) # blue
bldwht=${txtbld}$(tput setaf 7) # white
txtrst=$(tput sgr0) # Reset
info=${bldwht}*${txtrst} # Feedback
pass=${bldblu}*${txtrst}
warn=${bldred}*${txtrst}
ques=${bldblu}?${txtrst}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment