Hello Dale,

The "Advanced Bash-Scripting Guide" (https://tldp.org/LDP/abs/html/)
has everything  you need to get up to speed with bash scripting and
it's full of examples for every concept explained in the guide.

On Tue, Jun 10, 2025 at 11:42 AM Dale <[email protected]> wrote:
>
> Dale wrote:
> > Howdy,
> >
> > <<< SNIP >>>
> > 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
> >
> > <<< SNIP >>>
> >
> > 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.
> >
> > Thanks.
> >
> > Dale
> >
> > :-)  :-)
> >
>
>
> I got the book in.  It's a good book for someone who is new to Linux.
> Maybe coming from Windows or something where commands are different.  It
> talks about a lot about common commands and such and does touch on
> scripts a bit.  Thing is, it isn't what I'm looking for.  I'm looking
> for how scripts work and how and why they are formatted and such.  I
> have questions like what does the "{" and "}" do?  How do I get it to
> check something and if one result matches it does A but if it is some
> other result it does B?  Example.

In the chapter 3 of the guide
(https://tldp.org/LDP/abs/html/special-chars.html) you'll find out
information about "{}". Then in chapter 7
(https://tldp.org/LDP/abs/html/testconstructs.html) you'll find
information about executing A or B using test constructs.

> I'm wanting to write a script that opens a encrypted drive and mounts
> the drive.  When I run the script, I first want it to check and see if
> it is still locked or not.  If it is still locked, ask for the
> passphrase and unlock.  If it is unlocked, then move to the next part
> for mounting.  If it is already mounted, then nothing is needed.  If it
> is not, mount the drive.  I'd also like it to print out what it is doing
> or not doing as well.  Back in the old basic days, we had "goto" and
> such.  I don't see that in bash type scripts.  Figure there is a way
> tho.  ;-)
>
> My question is this.  Do some of you have scripts that are fairly simple
> to figure out that does something similar to this that you can share?
> I'm wanting to check some scripts that are known to work and figure out
> how they work.  I tried to look at Frank's checksum script but that
> thing is HUGE.  I was lost before I even needed to scroll down.  Some
> fairly small and simple scripts may give me enough to figure out how to
> do what I want to do and understand it as well.  If someone has a script
> that is more like a example script, where the words used explain what
> the script is doing and why it is laid out a certain way, that would be
> really nice.
>
> The book is nice.  It's just not what I'm looking for.  I may try to
> find something cheap on Ebay.
>
> Thanks.
>
> Dale
>
> :-)  :-)
>

The guide is full of instructive examples, I'm pretty sure that you'll
find there most of the information that you need to write your script.

Cheers!

Reply via email to