News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by dotancohen on Thursday October 27, 2022 @08:26AM (#33356495)
There are three numbers in this industry: 0, 1 and infinity. Any other number - especially when stated as a rule, limitation, or law - is highly suspect.
Re:Shell Script Best Practices, from a decade of scripting t... by ndsipa_pomu on Thursday October 27, 2022 @10:21AM (#33357849)
0, 1, 3 and infinity
Re:Shell Script Best Practices, from a decade of scripting t... by NateEag on Thursday October 27, 2022 @12:15PM (#33359801)
Which works not just to preserve the previous statement from internal inconsistency, but also in regards to the incredibly useful Rule of Three (https://en.m.wikipedia.org/wiki/Rule_of_three_(computer_prog...).
Re:Shell Script Best Practices, from a decade of scripting t... by palunon on Thursday October 27, 2022 @12:34PM (#33360141)
> Which works not just to preserve the previous statement from internal inconsistency

It doesn't. You now have 4 numbers.

Re:Shell Script Best Practices, from a decade of scripting t... by ndsipa_pomu on Thursday October 27, 2022 @01:27PM (#33360966)
0, 1, 3, 4 and infinity - there's four numbers in this industry.

Five There's five numbers in this industry 0, 1, 3, 4, 5 and infinity

Wait, I'll come in again

Re:Shell Script Best Practices, from a decade of scripting t... by tuatoru on Thursday October 27, 2022 @11:53PM (#33367482)
0, 1, 7, and indeterminate, IME.

The 7 being for design. If there are more than 7 boxes on the whiteboard, try again.

Re:Shell Script Best Practices, from a decade of scripting t... by sargstuff on Friday October 28, 2022 @10:19PM (#33380353)
ah, log base 2 of 7 is 127 bits (aka 8, y 1).

Unicode character can have more than 7 font boxes associated with one character box and still be a valid determinate character form.

Re:Shell Script Best Practices, from a decade of scripting t... by sargstuff on Friday October 28, 2022 @11:36AM (#33372793)
thought the industry was broken down in 8 bit increments (0, 8, 16, 32, 64, 128, etc)

log base 2 of 4 is only 16bits

Re:Shell Script Best Practices, from a decade of scripting t... by NateEag on Sunday October 30, 2022 @09:46PM (#33401101)
Good point. I'm not sure why I thought what I'd written above worked... shrug
Re:Shell Script Best Practices, from a decade of scripting t... by pferde on Thursday October 27, 2022 @12:44PM (#33360283)
Are you one of those people who take everything literally, so any and all jokes fly far over their heads?

This rule of ten lines or less is clearly meant as an illustrative guideline. Obviously if you have a shell script that has 11 lines, but does what it has to do reliably, nobody will be bothered.

The idea that the rule is trying to convey is "don't write long, complex programs in shell". Arguing about exact numbers or wording here is detracting from the topic at hand.