Brent Saner on 29 Oct 2007 22:42:48 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: scripting books (was Re: [PLUG] non-nerdy ... a non-rant)

  • From: "Brent Saner" <brent.saner@gmail.com>
  • To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
  • Subject: Re: scripting books (was Re: [PLUG] non-nerdy ... a non-rant)
  • Date: Mon, 29 Oct 2007 18:42:40 -0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=/89cYX3JmhrzuacrKeXwrs35PmZWXex+gzotRqCTcrI=; b=ZF0DN1ipD83AFfY/f9HIKm9fOhxAxp80oW1H4GzY5bJLzhzPIYZJfc7tGOO5Tr9IByMVZartieVyDjnITFzLHYiAt5JFlQ90n+T+t3hJZnqHosUPRCUjcV2lIAZSXlonrQyCafEBCZET9vpSSCavEGRyWndpYSDWz467nvwjzqA=
  • Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
  • Sender: plug-bounces@lists.phillylinux.org

thanks, JP! i'm an o'reilly whore myself. i think i have almost the whole library in e-book form

i haven't read through the bash cookbook yet but i've only heard good things! i'll be sure to look into it.

On 10/29/07, JP Vossen <jp@jpsdomain.org> wrote:
> Date: Fri, 26 Oct 2007 22:44:08 -0400
> From: "Brent Saner" <brent.saner@gmail.com>
> Subject: Re: [PLUG] non-nerdy ... a non-rant

[Brent]: oooh, you're about to pop your scripting cherry!
[Jeff]: much like the other one, I prefer having someone else involved.

I can help...  Oh wait, that really didn't come out right...  What I
*mean* is, I wrote a book about that.  No, no; *scripting;* I wrote a
book about *scripting*...  (Advice when you've dug yourself into a
hole--stop digging! :-)


<snip>

> there are a lot of really great texts out there for scripting. i MUST
> recommend "A Practical Guide to Linux: Commands, Editors, and Shell
> Programming" by Mark G. Sobell (of the Sobell publishing house, i
> believe), as well as "Linux Shell Scripting with Bash" by Ken O.
> Burtch.
>
> the former is a HUGE tome, filled with excercises and summaries and
> reviews. the latter is a smaller book but focused more on actual
> scripting theory.

I would *personally* recommend:

        Learning the bash Shell3 (LtbS3)
                 http://www.oreilly.com/catalog/bash3/index.html
        Classic Shell Scripting (CSS)
                http://www.oreilly.com/catalog/shellsrptg/
        bash Cookbook
                http://www.oreilly.com/catalog/9780596526788/index.html

As some of you know, I'm an O'Reilly book bigot--I just love their
books, especially the Cookbook and Hacks series.

Also, in the interest of full disclosure, I wrote about 48% of the _bash
Cookbook_... :-)

LtbS3 is the intro.  CSS is kind of intermediate, though it also
branches out to other tools and shells (besides bash), which is a good
thing.  And the cookbook is just that, a cookbook.  It won't help you
learn in any kind of step-by-step way, but if you are the kind who'd
rather learn by example you can do that.  Or if you just want the
answer, or something "close enough;" that's what it's for.

Having said that, we don't really cover "backups" in any specific way,
though lots of the bits and pieces will apply to parts of the backup
problem.


On a personal note, I used to do a lot of DOS (yes DOS) and Windows
batch files, which in the Unix/Linux world are called shell scripts.
Same thing, slightly different name.  command.com and later cmd.exe are
really terribly bug ridden and inconsistent.  They drive me crazy when I
still have to do anything in them, as the simplest things are so hard
and so awkward.

My favorite pet peeve (if that's not an oxymoron) is getting the output
of some external tool into a variable.  In Unix/Linux this is trivial"
        somevar=`external_tool -foo -bar baz`
        --OR, the newer, more readable and nestable way--
        somevar=$(external_tool -foo -bar baz)

In Windows cmd.exe, it's:
        for /f %%x in ('external_tool -foo -bar baz') do set somevar=%%x

See http://www.jpsdomain.org/windows/winshell.html for more.

I'd love to say that for anything non-trivial on Windows, use Perl.  But
I can't because it's not built-in like cmd.exe is.  Also, I have not
explored Monad, err, I mean PowerShell, but from the examples I've seen
it looks like it combines all the worst traits of Java and C++.


Shutting up now...
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|        jp{at}jpsdomain{dot}org
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
Microsoft has single-handedly nullified Moore's Law.
Innate design flaws of Windows make a personal firewall, anti-virus
and anti-malware software mandatory. The resulting software arms race
has effectively flattened Moore's Law on hardware running Windows.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



--
Brent Saner
215.264.0112(cell)
215.362.7696(residence)

http://www.thenotebookarmy.org
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug