Replying to @anthropy@mastodon.derg.nz

@anthropy@mastodon.derg.nz @star@fed.amazonawaws.com I hate it because I want to use $_ as a "dummy" argument, to indicate "we don't care about this", and that it can get overwritten at any point (a lot like social convention is in other languages)
but sometimes I want to check if the variable is filled, even if it's the only time I use it
annoying to need to use other names specifically in bash (other shells work fine ofc)

Jul 5, 2026, 14:04 UTC

Replying to @6@possum.city

@6 @star add a backslash (\) before the variable, that way it won't get interpreted c:

I primarily use it interactively though. for scripts I actually prefer not to use bash/shell, because shell substitution is extremely vulnerable to issues, exploits, etc. I only really use it if it makes much more sense than something like python, e.g if there's a bunch of shell commands I just need to chain, but if it's more than a few lines and needs string operations I often just move over to python

Replying to @6@possum.city

@6 @star quoting definitely helps, but there are a lot of weird ways it can interact (some of which have now been fixed): en.wikipedia.org/wiki/Shellsho

I'm not going to tell anyone what to write their scripts in, I also have quite a few bash scripts myself, but it's quite a bit more finnicky and vulnerable to accidents than something like python due to the nature of its execution and substitution-based variable usage (like SQL w/o parameters), and python is there usually wherever bash is available.

en.wikipedia.orgShellshock (software bug) - Wikipedia