Live data from Hacker News

Pure Sh Bible

github.com

31–40 of 138 posts

Re: Pure Sh Bible

#31

Mildly annoyed when people constantly refer to their article as the Bible of X. For those of us who are religious, it is in poor taste.

It shouldn't. "Bible" etymologically derives from "book", and its meaning denotes an authoritative book, or "the" book on a topic. While it is true that the "Christian Bible" has customarily been shortened to just "Bible", in principle it is appropriate to call any authoritative book that claims to be "the" book on a topic as a "Bible", without necessarily carrying any religious connotations. That's not to say that p…

The common phrasing christians use is actually "The Holy Bible", with "Holy" being a common word in the bible meaning "set apart for God". So "The Holy Bible" is that particular "Bible" (book) which has been set apart for God.

In fact, calling it a Holy Bible implies there are Bibles which are not Holy. As one would expect, given a bible is just a book, in greek.

Re: Pure Sh Bible

#32
post #27
post #22

Earlier quoted context omitted.

How common is the expression "Qur'an of X" instead of Bible?

The "Torah of X" is fairly common.

But in Hebrew, "The Torah" doesn't mean a certain book anyway. There are "The five one-part-of-five's of Torah". The Torah is like the teachings, or the postulates, or the theory. So there's Jehova's Torah, or Torat Hashem; but there's also your mother's torah: "Remember, my son, your father's Mussar (= mores), and do not abandon your mother's Torah (= teachings)".

Re: Pure Sh Bible

#33
Regarding conditional expressions:

I found something neat recently. The coreutils version of `test` doesn't have this, and when you use `test`, typically what you're using is the coreutils one.

But if you use `builtin test` to force the bash builtin variant of `test`, this has a nice `-v` switch, which allows you to check if a variable is set.

I found out about this recently when I had to use it in my bash argument processing library, to check if an option expecting a value had not been provided a value (since checking for an empty variable instead would mean that an actual empty string would also be ignored). (see here: https://git.sr.ht/~tpapastylianou/process_optargs/tree/main/...)

Re: Pure Sh Bible

#34
post #27

Earlier quoted context omitted.

The "Torah of X" is fairly common.

But in Hebrew, "The Torah" doesn't mean a certain book anyway. There are "The five one-part-of-five's of Torah". The Torah is like the teachings, or the postulates, or the theory. So there's Jehova's Torah, or Torat Hashem; but there's also your mother's torah: "Remember, my son, your father's Mussar (= mores), and do not abandon your mother's Torah (= teachings)".

Sure, though the Latin and Greek words that Bible comes from don't mean any particular book either.

Re: Pure Sh Bible

#35
post #29
post #19

Earlier quoted context omitted.

I like busybox bash (especially on Windows) which is very much not bash. Busybox bash does not implement arrays, for starters, which is a deal breaker for many scripts. The Windows kernel forks processes about 10x slower than Linux, so these tricks have real performance value for POSIX-family shells running there.

As far as I can tell, there is no busybox bash. busybox's built-in shell is ash. There are options to enable a few bash-compatible extensions, but there is no "bash" applet.

Try the Windows version on frippery.org.

I see it in the screen capture.

https://frippery.org/busybox/index.html

Re: Pure Sh Bible

#37
post #35
post #29

Earlier quoted context omitted.

As far as I can tell, there is no busybox bash. busybox's built-in shell is ash. There are options to enable a few bash-compatible extensions, but there is no "bash" applet.

Try the Windows version on frippery.org. I see it in the screen capture. https://frippery.org/busybox/index.html

There's an option to install the "bash" applet as a link to either ash or hush, the two shells that busybox comes with. Turns out that a large number of "bash scripts" use no bash-specific features in spite of using "bash" in the #!, or only a few bash-specific features like [[ ]].

It's disabled by default, and arguably not a good idea to enable it because compatibility is not great as you found out. Either way, "busybox bash" doesn't exist: only the option to alias ash or hush to bash.

Re: Pure Sh Bible

#38
post #7

I have to take exception to some of this; it's "technically correct" but like much of shell, likely full of terrifying edge cases that are best avoided. For instance, using eval to have variables with variable names is madness. $ var="world" $ eval "hello_$var=value" $ eval printf '%s\n' "\$hello_$var" I suppose the fancy business with printf is flexing, but I suspect the majority of people scanning documents like th…

> I suppose the fancy business with printf is flexing, but I suspect the majority of people scanning documents like this would prefer to have examples with echo "${variable%%string_modifier}" POSIX itself contains some interesting notes about `echo` and `printf`, e.g. from the `printf` page: "The printf utility was added to provide functionality that has historically been provided by echo. However, due to irreconcila…

There are a huge variety of things you can do in shell that you simply shouldn't. If you're adventuring into a world where it matters if there's a newline at the end of your output as a result of your script running on noodlebsd or ache or freeGum, you've already lost.

Don't play the game. Don't do things where it matters what the exact output of echo gives you.

Did you know that you can't put a null into a shell variable? You can't. Also, you shouldn't ever be in a position to care. Did you know that you can fiddle with the "IFS" to let you parse CSVs? Don't ever do that; it works but nobody will ever understand what the hell you did. You can make an case statement and evaluate it with eval to make your own shell script that writes its own shell scripts. Please don't.

All of these adventures are possible, and work fine, and I've done them and come back to the code a decade later and I both understand what I was trying to do and the code still works across a variety of bourne shell interpreters. Nevertheless, these are things that shouldn't be done except to flex.

Re: Pure Sh Bible

#39
post #19
post #8

If we're going to be purists, sh is a far cry from bash. /s tongue in cheek, please don't kill me. I love bash and I use it often. I love Greg Wooledge's bash guides and all the people in #bash@libera.

I like busybox bash (especially on Windows) which is very much not bash. Busybox bash does not implement arrays, for starters, which is a deal breaker for many scripts. The Windows kernel forks processes about 10x slower than Linux, so these tricks have real performance value for POSIX-family shells running there.

You can implement arrays for POSIX shell in POSIX shell by changing the input separator to new line, and writing some simple helper functions to search for it. It’s not the prettiest solution but works for many use cases of arrays in shell scripts.

Re: Pure Sh Bible

#40
post #22

Earlier quoted context omitted.

Even as someone who grew up in a very religious household, I am still struggling to come up with a “steel-man” argument on your behalf. Can you explain why you believe it is in poor taste?

How common is the expression "Qur'an of X" instead of Bible?

“The Mecca of X” is common enough. I’ve said “The Mecca of Nerds” to refer to Microcenter on a few occasions.
Post reply on HN