Last Updated: February 25, 2016·
Script to create a file in a non-existing folder
Copy this script in a mtouch file and add the execution bit:
#!/bin/sh [ ! -z $1 ] && (mkdir -p `dirname $1`; touch $1)
Then run it as follow:
This will create the folder /some/folder/which/does/not/exist/for/the/file and then touch the file F in this folder.
Written by padawin
Have a fresh tip? Share with Coderwall community!
Post a tip
Best #Script Authors
Sponsored by #native_company# — Learn More