Closed BenBE closed 4 years ago
The script may be shortened by using mkdir -p "$Y/$M/$D" instead of that cascade of nested if statements. Also traversing into that directory can be simplified when using pushd "$Y/$M/$D"/popd …
mkdir -p "$Y/$M/$D"
if
pushd "$Y/$M/$D"
popd
You don't even need to eheck [ ! -d "$Y/$M/$D" ] as mkdir -p is a no-op if the target already exists.
[ ! -d "$Y/$M/$D" ]
mkdir -p
Ah, true. Also eliminated entirely by #6.
The script may be shortened by using
mkdir -p "$Y/$M/$D"
instead of that cascade of nestedif
statements. Also traversing into that directory can be simplified when usingpushd "$Y/$M/$D"
/popd
…