Skip to content

Instantly share code, notes, and snippets.

@brunerd brunerd/nothing
Created Feb 19, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.