Skip to content

Instantly share code, notes, and snippets.

@dpie
Created September 15, 2010 04:06
Show Gist options
  • Save dpie/580226 to your computer and use it in GitHub Desktop.
Save dpie/580226 to your computer and use it in GitHub Desktop.
# Terminitor (Ruby gem) command shortcuts
# term PROJECT >> terminitor start PROJECT
# term PROJECT open >> terminitor open PROJECT
function term() {
if [ -z "$1" ]; then
echo Project argument required
else
local terminator_project="$1"
local terminitor_action="${2:-start}"
terminitor "$terminitor_action" "$terminator_project";
fi
}
@ilikepi
Copy link

ilikepi commented Sep 15, 2010

Woops, damnit.

${var:-default} is the syntax for specifying a default expansion value. The '-' doesn't imply anything really, it's just a syntax token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment