Wiem, że możesz mkdirutworzyć katalog i touchplik, ale czy nie ma sposobu, aby wykonać obie operacje za jednym razem?
tj. jeśli chcę wykonać poniższe czynności, gdy folder othernie istnieje:
cp /my/long/path/here/thing.txt /my/other/path/here/cpedthing.txt
Błąd:
cp: cannot create regular file `/my/other/path/here/cpedthing.txt': No such file or directory
Czy ktoś wymyślił funkcję jako obejście tego problemu?