Sujet : Re: Over-Elaborate Shell Scripting
De : josef.moellers (at) *nospam* invalid.invalid (Josef Moellers)
Groupes : comp.unix.shellDate : 24. Mar 2024, 19:30:44
Autres entêtes
Message-ID : <l6b9qkF5volU1@mid.individual.net>
References : 1 2
User-Agent : Mozilla Thunderbird
On 23.03.24 19:19, Grant Taylor wrote:
On 3/23/24 00:38, Lawrence D'Oliveiro wrote:
When using a computer, laziness is a virtue. This is why we have command lines, to help automate the boring and repetitive tasks.
Yes.
This article <https://arstechnica.com/gadgets/2021/09/command-line-wizardry-part-two-variables-and-loops-in-bash/> continues the author’s intro to basic command-line concepts. But it repeats a failing I see all too often in shell scripting: doing complex parsing of the output of some command, when the command itself offers an option to produce something closer to the exact output you need.
Keep in mind that some such authors have been working with a command for a very long time and that there is chances that the command has evolved since they started using it.
Keep also in mind that MAYBE not all incarnations of a command may have this feature, so resorting to a generic solution that works on all versions of the command may be a virtue.
Josef