Jakob77 wrote: Wed Jun 04, 2025 8:18 pm
I believe the last part is too complicated for a user script like "xinitrc"
This is nonsense. Bad code that's easy to understand is still bad code. The issues in the logical flow of the original version make understanding it harder, not easier. No one says "If you're out of milk, go to the store. If the store is open, find the milk. If the store is open, check the milk's expiration date. If the store is open, buy the milk." Code that doesn't stutter is code that's easier to read and easier for people to follow what it's trying to accomplish.
Jakob77 wrote: Wed Jun 04, 2025 8:18 pm
I am not familiar with the shell but
I noticed. Linux is one of the few self-documenting operating systems where man pages come with the OS for free. If you're going to urge people to run mkdir(1), you should at some point understand what it does. Then take steps to ensure your software (1) does what it's supposed to do, and (2) doesn't do what it isn't supposed to do. Allowing mkdir(1) to recursively create subdirectories isn't needed here. Instead of "well, putting -p here works so it's probably fine", I could just as easily argue "not putting -p here works and it limits the effect of the command to at most creating the single directory desired... so that's better".