upvote
I'd suggest `pwd -P` to resolve symlinks too. (if you use DIR to call/source neighbouring scripts).
reply
Wait... Most of my shell scripts have zero unused variables: I prefer to comment them if I may need them later on.

Why do you disable SC2034?

I don't think not having unused variables prevent me from doing things in my scripts!?

I understand if it's a preference but SC2034 is basically one of my biggest timesavers: in my case unused variables are typically a bug. Except, maybe, ANSI coloring variables at the top of the script.

reply
I disable it only for the DIR variable which I might not use.
reply