

All legit. At the end of the day, both the commands that go through systemd and the direct cat something >/proc/… or cat something >/sys/… are all doing the same thing - telling the kernel to do some procedure.
There’s some settings stuff in /proc and /sys that you don’t want to tweak without knowing the effects, as they could break things in hard to fix ways, but for stuff like beeping or changing sleep states, the worst you’ll do is lock up your computer and need to reboot. And even that is rare unless the hardware really doesn’t like a particular sleep state.
You’re probably wanting
[ -z "${VAR1}" -a -z "${VAR2}" ]
. Note in bash that there are minor differences in how[ ]
and[[ ]]
tests are handled. You can pull up a handy cheat sheet of the operands on most distros by runningman test
, though you’ll need to read through the CONDITIONAL EXPRESSIONS section ofman bash
if you want to see the minor differences of the single vs double square bracket commands (mostly whether locale applies to string order, as well as whether operands are evaluated in numeric comparisons).