Stuart P. Bentley

Results 161 comments of Stuart P. Bentley

Yeah, I've found that this is generally overkill, since I'm practically never expanding a variable next to a character that's a valid identifier character. I prefer curly-brace expansion as a...

Like, my boilerplate header in Plushu is ``` set -eo pipefail; [[ -n "$PLUSHU_TRACE" ]] && set -x ``` and right now I'm considering changing that, because if the rest...

> If the rest of the file is empty? When would you have a script that has nothing but this? When I'm creating stub scripts before filling them in. >...

Except tracing doesn't show any difference between tests _inside_ conditions and tests _outside_ them, so all you see is a series of `-f`, `-e`, `-z`, and/or `-n` tests, that suddenly...

Not to mention always using `if` is, stylistically, more consistent (and isn't consistent style the name of the game here?)

There's also `set -u`

I'm not into `set -u` either, but it's worth noting for people who want to write their own style guides. (It's also worth noting as a "critical section" wrapper that...

Of `printf %q`? The bash manual just says "causes printf to output the corresponding argument in a format that can be reused as shell input": in my experience, this can...

Saving variables in a generated script, or a list of environment variables like an app's .profile.d/app-env.sh in buildstep/herokuish (which reminds me of another tip/trick for the [High Codex](https://github.com/progrium/bashstyle/issues/16#issuecomment-70016159)).

I showed you yesterday how it's used in Pluchu to preserve argument quoting when reproducing the input arguments for ssh's command on the server: https://github.com/plushu/pluchu/blob/master/pluchu#L57 As you could probably guess,...