SyntaxFix
Write A Post
Hire A Developer
Questions
You could create a function that parses argument with sed;
sed
atouch() { mkdir -p $(sed 's/\(.*\)\/.*/\1/' <<< $1) && touch $1 }
and then, execute it with one argument:
atouch B/C/D/myfile.txt