Created
November 29, 2017 18:28
-
-
Save brianoflan/e3366521989192ebf35665cbf2c37cd6 to your computer and use it in GitHub Desktop.
Touch a file - and create any necessary folder structure to do so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch_p() { mkdir -p "$(dirname $1)"; touch "$1"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get this into coreutils as
touch -p
, quick! https://linux.die.net/man/1/touch