Skip to content

Instantly share code, notes, and snippets.

@brianoflan
Created November 29, 2017 18:28
Show Gist options
  • Save brianoflan/e3366521989192ebf35665cbf2c37cd6 to your computer and use it in GitHub Desktop.
Save brianoflan/e3366521989192ebf35665cbf2c37cd6 to your computer and use it in GitHub Desktop.
Touch a file - and create any necessary folder structure to do so
#!/bin/bash
touch_p() { mkdir -p "$(dirname $1)"; touch "$1"; }
@brianoflan
Copy link
Author

Get this into coreutils as touch -p, quick! https://linux.die.net/man/1/touch

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