The O is for the kind of whooshing sound
The O is for the kind of whooshing sound
Yeah, none of that with bat
:
λ bat $(type -P bat)
───────┬──────────────────────────────────────────────────────────────────────────
│ File: /usr/bin/bat <BINARY>
───────┴──────────────────────────────────────────────────────────────────────────
λ bat < $(type -P bat)
───────┬──────────────────────────────────────────────────────────────────────────
│ STDIN <BINARY>
───────┴──────────────────────────────────────────────────────────────────────────
λ
Or bat
, which will just print <binary>
in those cases
I think some of the stuff you worry about as a kid will just arise naturally. Ideas like not stepping on cracks, or imagining monsters in dark places are likely produced spontaneously and naturally by an underdeveloped ape brain.
But it’d be nice if we didn’t tell kids about old superstitions, yeah. Wait until they’re old enough to react with dismissal about the stupid stuff people used to believe.
I thought we were calling the thing you speak Strayan!
Wer braucht denn eigentlich Jon Oliver, wenn wir Jan Böhmermann haben?
Alternatively: Finally I can practice my school German!
You can give her limited sudo rights; even limit her to install and upgrade operations.
Yeah, while -e
has a lot of limitations, it shouldn’t be thrown out with the bathwater. The unofficial strict mode can still de-weird bash to an extent, and I’d rather drop bash altogether when they’re insufficient, rather than try increasingly hard to work around bash’s weirdness. (I.e. I’d throw out the bathwater, baby and the family that spawned it at that point.)
Yeah, there’s also a subtle difference between ${1:-}
and ${1-}
: The first substitutes if 1
is unset or ""
; the second only if 1
is unset. So possibly ${foo-}
is actually the better to use for a lot of stuff, if the empty string is a valid value. There’s a lot to bash parameter expansion, and it’s all punctuation, which ups the line noise-iness of your scripts.
I don’t find it particularly legible or memorable; plus I’m generally not a fan of the variable amount of numbered arguments rather than being able to specify argument numbers and names like we are in practically every other programming language still in common use.
Yeah, another way to do it is
#!/bin/bash
set -euo pipefail
if [[ $# -lt 1 ]]
then
echo "Usage: $0 argument1" >&2
exit 1
fi
i.e. just count arguments. Related, fish
has kind of the orthogonal situation here, where you can name arguments in a better way, but there’s no set -u
function foo --argument-names bar
...
end
in the end my conclusion is that argument handling in shells is generally bad. Add in historic workarounds like if [ "x" = "x$1" ]
and it’s clear shells have always been Shortcut City
Side note: One point I have to award to Perl for using eq/lt/gt/etc
for string comparisons and ==/</>
for numeric comparisons. In shells it’s reversed for some reason? The absolute state of things when I can point to Perl as an example of something that did it better
#!/bin/bash
set -euo pipefail
if [[ -z "${1:-}" ]]
then
echo "we need an argument!" >&2
exit 1
fi
There’s also no uppercase d in systemd
, the word is entirely lowercase (but I’ll still write it with an uppercase s at the start of sentences).
Yeah, the manpages for systemd are large but also informative. Most of us only use a small subset of the features—much like we never explored everything possible with separate init programs.
Having used Linux on the desktop for some two decades and worked as a Linux sysadmin for a good while I don’t miss the init scripts. My impression is more that a certain cohort wants to pretend that service management is easy by ignoring large amounts of it. It’s easy to write a bad init script that breaks when you really need it, or be out of your depth with more complex cases.
Not to mention the whole conformity by convention thing. Systemd unit files are descriptive and predictable by their nature. So-called init scripts didn’t really have to be scripts, they just usually were, and their arguments and output and behaviour was also unenforced—there’s nothing really stopping you from writing a compiled program that self-daemonizes and place the binary with the init scripts rather than in /bin. Ultimately people who make programs also have to be good at writing init programs with that setup.
So we’d have people doing dumb shit themselves and getting angry at others doing dumb shit. PHP was also pretty popular and full of dumb shit. Lots of “worse is better” to go around.
Ultimately it’s more of the stuff covered in Bryan Cantrill’s Platform as a reflection of values. Some of us value predictability and correctness, others feel it’s a straitjacket. There’s no way of pleasing everyone with the same platform.
And currently the people who want to distribute their own riced-out init programs in bash, perl, php, node.js and so on are SOL. (They can still use them on their own machines.)
I escaped reddit for this?