Skip to content

Instantly share code, notes, and snippets.

@brunerd
Last active February 10, 2020 03:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunerd/8474ba08520c6c53d7380325d722803e to your computer and use it in GitHub Desktop.
Save brunerd/8474ba08520c6c53d7380325d722803e to your computer and use it in GitHub Desktop.
Uses of : (no effect)
#to officially do nothing
:
#there you go, this could be used when writing or troubleshooting a script and you have only a single item in an if clause
if [ "${this}" = "that" ]; then
#actually not sure what to do here, let's do nothing
:
else
echo "This else, I'll do"
fi
# A novel use I found is to redirect a heredoc into :
# jbeck at Extensis does this in the UTC removal script
#https://support.extensis.com/Support/58278/58411/en-US/Article/View/1004/Uninstalling-Universal-Type-Client-for-Mac-OS/64
: <<COMMENTBLOCK
[ ] 2016-0324: enclose me; love me. i am a block of comments
COMMENTBLOCK
#and replacing the delimiter COMMENTBLOCK allows for a nice header
: << NOTES
Some notes about this script
NOTES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment