#!/bin/bash function helpexit() { echo Print out bibtex entry from a DOI. echo Give DOI code as the argument exit } [[ -z "$1" ]] && helpexit [[ "$1" = "-h" ]] && helpexit curl -LH "Accept: text/bibliography; style=bibtex" "http://dx.doi.org/$1"