[Cialug] Tasks for learning shell scripting
Don Ellis
don.ellis at gmail.com
Wed Sep 29 10:23:35 CDT 2010
And, on the other hand, many times in shell scripting, I find that
Perl is an easier tool to use. Often, when writing (or having written)
a slightly more complicated script, I wish I had written it in Perl
instead of bash/ksh.
[Back to shell] When writing in shell, consider the differences
between ksh and bash. I think I've heard that ksh has some constructs
that work better for scripting (can't remember them offhand), but bash
is easier for login. For the really basic scripting, bash or ksh can
be good enough, especially if you teach the more advanced tools, such
as functions and hashes. Once you get to this level, though, Perl
starts getting simpler very quickly.
Another thing, bash is often the default shell and ksh is an optional add-on.
For a root login, sh is often used for the login shell because it is
on a filesystem that is mounted first, and doesn't depend on later
boot stages. However, for some systems, bash is used for root login,
since it is also on an initial filesystem. If a script might be run
before other filesystems are mounted, be sure the shell it runs in is
present when it's needed.
--Don Ellis
On Wed, Sep 29, 2010 at 8:43 AM, Josh More
<MoreJ at alliancetechnologies.net> wrote:
> For one-on-one tutoring, toss them one of the books mentioned earlier in the thread and then work with them on ways to automate their personal workflow. If they use Gnome, work with them to write nautilus scripts or custom session managers. Work your way up to more complex things like custom startup scripts for specific "daemons" (like every time the machine turns on, launch an irc client as a screen session and connect it to the key channels).
>
> Let them drive the direction.
>
> Avoid the Posix focus. Let them get the job done as quickly as possible and let them shoot themselves in the foot as quickly as possible. The harder you make it to learn, the more resistant your mentee will be to learning. This is why I maintain that Perl is the absolute best first language to learn. In the shell world, this would be Bash.
>
>
> -Josh More, CISSP, GIAC-GSLC, GIAC-GCIH, RHCE, NCLP
> morej at alliancetechnologies.net
> 515-245-7701
>
> ________________________________________
> From: cialug-bounces at cialug.org [cialug-bounces at cialug.org] on behalf of Matthew Nuzum [newz at bearfruit.org]
> Sent: Wednesday, September 29, 2010 08:35
> To: Central Iowa Linux Users Group
> Subject: Re: [Cialug] Tasks for learning shell scripting
>
> On Wed, Sep 29, 2010 at 7:55 AM, Josh More
> <MoreJ at alliancetechnologies.net> wrote:
>> Who is the curriculum for?
>>
>> Newbies in college, professionals transferring from Windows, employees at Canonical?
>>
>
> I know someone who wants to learn about scripting. An experienced
> computer user with Windows and Linux but just wants to go in a little
> deeper.
>
> My original intention was to teach using a posix only shell because
> I've gotten myself into trouble when not using a modern Linux
> distribution (Solaris). Also, Debian based distros have stopped using
> bash as /bin/sh because it significantly slows down boot speed,
> instead they use dash, a posix shell that loads much quicker. (but
> they use bash for the interactive shell still)
>
> Do you agree that my reasoning for using a posix shell is wise or is
> it really negligible and I should take the easy road of bash? And on
> the heals of that, if someone uses standard posix methods that skill
> works perfectly in bash, right?
>
>
> --
> Matthew Nuzum
> newz2000 on freenode, skype, linkedin, identi.ca and twitter
>
> "An investment in knowledge pays the best interest." -Benjamin Franklin
More information about the Cialug
mailing list