[フレーム]
Last Updated: February 25, 2016
·
317
· padawin

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:

/patch/to/mtouch /some/folder/which/does/not/exist/for/the/file/F

This will create the folder /some/folder/which/does/not/exist/for/the/file and then touch the file F in this folder.

AltStyle によって変換されたページ (->オリジナル) /