• Re: [gentoo-user] Books about making shell scripts and other nifty comm

    From Eli Schwartz@21:1/5 to Mark Knecht on Thu Jun 5 18:10:02 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------IPSofkbdwFXQIxJkVff736F2
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 6/5/25 11:32 AM, Mark Knecht wrote:
    A book is one way to go, especially if someone trusted recommends
    the title.

    As for me - and this isn't bash scripting - but I've learned Python just using videos on YouTube coupled with asking AI Helpers {Chat GTP,
    Gemini, Claude, Deepseek, Copilot} either questions I want answered
    or, more importantly, providing it with some code I wrote and asking it
    two basic questions:

    1) What does this code do?

    2) Are there any problems this code might cause or side effects I
    should be aware of?

    Those two questions plus a copy of my real data I want to work on
    so that it doesn't make a mistake and delete or corrupt my real data
    have allowed me to make a lot of progress without spending a
    penny. I suspect this would work well for you if it suits your learning style.

    I see plenty of videos on YouTube about bash scripting.

    All of the AI helpers will answer 20-30 questions a day for free so
    there's no cost involved, and you can ask each of them the same
    questions to get multiple points of view on solving your problems.


    Artificial non-intelligence is based on a sophisticated https://en.wikipedia.org/wiki/Mad_Libs generator. It is a program
    designed to produce pseudorandom output streams with a weight towards grammatically correct output.

    It possesses no knowledge or reasoning and literally *cannot* possess
    the attribute of being correct. It is very good at superficially looking correct. Whether or not it actually is correct is up to a roll of the dice.

    Any knowledgeable AI user will tell you: AI *cannot* be safely used
    unless you already know what you are doing and can review the results
    before running it. AI proponents find AI useful to reduce the manual
    labor involved in writing the script -- ***not*** for figuring out the
    correct thing to do. This is an iterative process of rejecting answers
    that look wrong and tweaking the prompt, getting the AI to try again and
    again until it gets the right answer.

    DO NOT USE AI AS A TEACHER. YOU WILL BREAK YOUR SYSTEM IRREPARABLY.

    You will delete all your data by accident.

    You will be the latest example of a foolish fool posting on Reddit in
    tears, asking if there is any way to recover years worth of labor that
    wasn't backed up properly.

    You will learn nothing, or you will learn how to write incorrect and
    buggy scripts because you aren't able to evaluate which answers are hallucinations.


    --
    Eli Schwartz

    --------------IPSofkbdwFXQIxJkVff736F2--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCaEG/jwUDAAAAAAAKCRCEp9ErcA0vVyG8 AQCcwErc7INMX3tp3xJTfTpQnUxrkddjceWnBOfqp1pbEgEAlYqurZzc787xuR4NAdLXVgAmsOcT rrFrWavkfpvgbQE=
    =dXZS
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jay Faulkner@21:1/5 to Eli Schwartz on Thu Jun 5 19:10:01 2025
    On 6/5/2025 9:02 AM, Eli Schwartz wrote:
    Any knowledgeable AI user will tell you: AI*cannot* be safely used
    unless you already know what you are doing and can review the results
    before running it.

    I use LLM-based tooling frequently in my job, and this really is the
    key. You have to be able to detect when something looks plausible but
    may not work. Even worse, using it as a learning tool, you may not be
    learning the conventions folks generally abide when using these. In my experience; even when prompted well (which requires domain knowledge in
    the topic you're prompting about) it gets things right about 70%-80% of
    the time -- and some of those are sneaky hard to find unless you know
    what to look for.

    That doesn't mean it's useless -- far from it -- but it does mean you
    probably shouldn't be using it as a primary source to learn from. At
    least in it's current form.

    -JayF

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Mark Knecht on Thu Jun 5 19:30:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------wIf0DiuJNmjdKV0g0gz5bBfN
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 6/5/25 12:16 PM, Mark Knecht wrote:
    <hehe>

    I sense a certain overriding fear about the future...

    </hehe>


    I'm not worried about the future, I'm worried about today, and today's
    users seeking help and getting led astray.


    To each his own. I agree with you in general - don't trust AI with
    anything important. If you prefer then 'trust but verify'.


    I don't consider AI to provide value enhancement for me at all, for much
    the same reason as described at

    https://infosec.exchange/@david_chisnall/113690087142854474

    It saves time on writing code. It costs *more* time in debugging subtle
    edge cases. This is a steep disadvantage for a technology that is full
    of questions about legal liability!

    Of course, your mileage may vary... if it's only for personal use you
    may not care about legal liability, and if you couldn't write it
    yourself at all then maybe the debugging is worth it.



    --
    Eli Schwartz

    --------------wIf0DiuJNmjdKV0g0gz5bBfN--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCaEHRkwUDAAAAAAAKCRCEp9ErcA0vVzPU AP9OKw7wOwWYWUkj/X7Bml2efPpt3uPE5QkDNMSlKEcL8AEAypDxwu2IrGgppQpryHoIGqBW+1E7 VCbhVooM9wqm0Ao=
    =Gf0E
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From eric@21:1/5 to Dale on Thu Jun 5 19:50:01 2025
    On 6/5/25 09:59, Dale wrote:
    I'm not big on the AI thing yet either.  Reminds me of that movie
    Terminator and a few others.  I'm not real sure about us going down that road myself.

    One thing I like about the book I linked to, it is new.  It should be
    good for all the new versions of software.  The bad thing about being
    new, no one has wrote a review on it yet.  I was hoping someone here
    might have bought a copy or knew someone who did.  I think I'll risk it
    and just buy the thing.  I'm not looking to create a new distro or
    anything so it should hopefully be good enough, if I can understand what
    it is saying.

    Like that command mountpoint.  I was wondering how one can check if something is mounted or not.  No idea that existed.  o_O

    I'll post back when it comes in and I get a chance to read it.  If I can figure out what it is saying, it should be good for almost anyone.  😂

    Thanks.

    Dale

    Dale,

    Have you gotten in touch with the author to see if AI was used to help
    write the code in the book? As the book was released just last month and
    AI has become very popular as a helper with creative and programming activities, there is always the chance that using the book will only be avoiding AI in the most direct way. :-)

    Sorry, I could not help myself. Both people and AI are fallible, so
    always test your code out as was suggested before using it on your systems.

    I have bought many linux books through PackT
    (https://www.packtpub.com/en-us) and Humble Bundles (https://www.humblebundle.com/books), even some from Oreilly (https://www.oreilly.com/) before they became a subscription service.
    Many of them started out great in the first chapter or two, and then
    whoosh, I could not follow along. I don't know if it was me or the books
    that were causing the misunderstanding. :-)

    I hope the book works out great for you and helps you make your goal.

    Regards,
    Eric

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From yahoo@21:1/5 to All on Thu Jun 5 20:00:01 2025
    Il 05/06/25 05:49, Dale ha scritto:
    Howdy,

    As most know, I have very basic script skills.  Most of you wouldn't
    even call my stuff scripts most likely.  I'm not sure if they meet the definition either.  I have quite a few "scripts" that I use to do all
    sorts of things.  I use scripts to unlock and mount encrypted drive
    sets, update backups and all that sort of thing.  I'd like to add some things to my little scripts but don't know how.  I know it can be done tho.  Example.  I'd like to add a section that when I run a script to unlock and mount a drive set, I'd like it to check and make sure it
    isn't already open and/or mounted.  If it is not one or both of those things, then do whichever one, or both, that are not already done.  For
    my backup scripts, I'd like to add a section that makes sure the drive
    set for the backup is unlocked and mounted first.  If not, print out
    that it is not mounted and stop.  I wouldn't mind learning some other
    stuff to.  I just want to keep the cost down a bit, used is also a
    option if in real good shape.  I also don't want to buy a book that
    doesn't have what I need.
    Advanced Bash-Scripting Guide (https://tldp.org/LDP/abs/html/)

    Available for free online so you can see if all you need is in, or in
    printed version from various resources. Full of code snippets to get you started.

    It's not an easy read but the fault is bash, not the author's!
    bash syntax looks like it was studied to make you forget even the
    simplest things in no time, if you don't use it everyday (which I don't).

    raffaele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From yahoo@21:1/5 to All on Thu Jun 5 20:40:01 2025
    Il 05/06/25 05:49, Dale ha scritto:
    So, I'm looking for a book, paperback would be nice but hardback is fine too.  I found this.  I may look for a used version elsewhere too.
    Reading what is described, this sounds like a good place to start.

    https://www.amazon.com/Super-Easy-Linux-Bash-Scripting/dp/B0F7GF439K

    Any thoughts on one I linked too?  Will that be OK for me to start out
    with given my VERY basic skills?  Know of something better?  When I was
    a kid, I was pretty good with BASIC on the old Commodore VIC-20 and 64.
    That was a LONG time ago tho.

    I doubt anybody would find useful and complete the "Setting up a Linux environment" page visible in the preview.

    Also, 120 pages to explain Linux commands _and_ bash seem too few to
    really progress you from beginner to advanced.

    raffaele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Arve Barsnes on Thu Jun 5 21:10:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------g7A0wtSGHdwi4erpPTS5sDy4
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 6/5/25 2:48 PM, Arve Barsnes wrote:
    On Thu, 5 Jun 2025 at 19:56, yahoo <mentadent47@yahoo.com> wrote:
    Advanced Bash-Scripting Guide (https://tldp.org/LDP/abs/html/)

    Available for free online so you can see if all you need is in, or in
    printed version from various resources. Full of code snippets to get you
    started.

    Also the bash book from the bunch of programming books created by the StackOverflow bunch a few years ago. I remember those got good
    feedback.

    https://goalkicker.com/BashBook/

    Regards,
    Arve


    https://mywiki.wooledge.org/BashGuide is a must-read, I would say. In
    fact, the entire wiki is an excellent reference manual for both
    beginners and knowledgeable developers.


    --
    Eli Schwartz

    --------------g7A0wtSGHdwi4erpPTS5sDy4--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCaEHqeAUDAAAAAAAKCRCEp9ErcA0vV6jO AQDH6diFm2jDWmq+v3JIk4cSUSs8NlnK+6NJ/uI9fCed0wEAlZHGyrimtsPo8I9+/Im3V/rVXUpN zxOK6AnHyx95lg0=
    =nZ3o
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)