Maja changed the topic of ##bash-crimes to: we bash back | club of folks preoccupied in whether they could, not whether they should | logs https://libera.irclog.whitequark.org/~h~bash-crimes
<spiderella> I invented a thing
<spiderella> You know ${var?error message here} ?
<spiderella> It prints that error message if the variable is not defined
<spiderella> Introducing: ${var+${error message here}}
<spiderella> If var is defined it causes a syntax error which prints the error message
<spiderella> Because of the spaces
<spiderella> Works in bash dash zsh mksh
<spiderella> It doesn't work in ksh or yash but from reading the standard I believe it should
mwk has quit [Ping timeout: 272 seconds]
<sdomi> spiderella: gosh this is cool
<sdomi> wonderful hack
<misentropy> neat