Skip to content

Instantly share code, notes, and snippets.

@jonahbron
Created December 18, 2013 00:27
Show Gist options
  • Save jonahbron/8015330 to your computer and use it in GitHub Desktop.
Save jonahbron/8015330 to your computer and use it in GitHub Desktop.
Create a new, empty file if it does not exist. Creates parent directories if necessary.
# Create a new, empty file if it does not exist. Creates parent directories if necessary.
#
# author Jonah Dahlquist
# license CC0
punch() {
mkdir -p $(dirname $1)
touch $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment