1 2 3 4 5
# Create paths to all files before invoking editor for file do mkdir -p -- "${file%/*}" || exit done exec "$EDITOR" "$@"