Created
January 15, 2016 21:13
-
-
Save devinivy/50d7f6b1102e55e017dc to your computer and use it in GitHub Desktop.
Create all necessary dirs while touching a file
This file contains 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
# from http://unix.stackexchange.com/a/168582 | |
supertouch() { | |
for p in "$@"; do | |
_dir="$(dirname -- "$p")" | |
[ -d "$_dir" ] || mkdir -p -- "$_dir" | |
touch -- "$p" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment