Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2002 15:49:45 -0500
From:      Jim Conner <jconner@enterit.com>
To:        "Bob Giesen" <BobGiesen@earthlink.net>
Cc:        "Bernie" <Bernie_X@myrealbox.com>, "freebsd-questions" <freebsd-questions@FreeBSD.org>
Subject:   Re: shells confusion
Message-ID:  <5.1.0.14.0.20020126154711.049c6860@mail.enterit.com>
In-Reply-To: <004301c1a684$0de9bb00$ab41d03f@pegasus>
References:  <20020126020430.P175-100000@BLAST>

next in thread | previous in thread | raw e-mail | index | archive | help
At 10:11 01.26.2002 -0600, Bob Giesen wrote:
>    For scripting, the most logical choice to learn first is the Bourne shell
>(/bin/sh on most systems).  As you've noted, the vast majority of existing
>scripts that are supplied with systems are written in Bourne, so you will
>have little trouble translating what you learn to all those examples that
>you have available to you.  Also, should you desire to modify any of those
>scripts, you will be less likely to break them through syntax errors.
>(Notice the "#!/bin/sh" at the tops of those scripts?  The leading "#!"
>tells the invoking shell to run the script in a subshell of the following
>command (/bin/sh, in this case).  So, if you were to insert something from
>ksh (Korn Shell), e.g., that /bin/sh doesn't understand, the script will
>fail.)
>    Once you're comfortable with sh, you'll want to consider looking at the
>other shells -- especially if you work at the command line a lot and/or do a
>lot of scripting.  Most other popular UNIX command shells (ksh, bash, zsh)
>are mostly supersets of the Bourne shell, so you will find it very easy to
>take advantage of their extended features after you've learned Bourne.  It
>is a natural progression.  However, should you learn one of those whiz-bang
>shells, first, you may find dealing with Bourne-shell scripts a bit more
>frustrating when you find that you have to take into account its
>limitations.

I seconds Bob's comments. :)  You will eventually mold yourself into the 
best you can be with whatever language you choose.  However, the starting 
point is generally plain old sh (Bourne).  And its not hard to move on to 
the more "advanced" shells for scripting use.  I've already made my choice 
quite clear.  You will do research into your most favorite as time 
progresses.  Most likely, you will get to a point where you need to do 
something advanced in your script like an array and you will notice that sh 
just doesn't do that.  Then you will venture into a shell language that can 
do it.  That's how it happened to me and I chose and expanded into the 
world of Korn.

- Jim

>----- Original Message -----
>From: "Bernie" <Bernie_X@myrealbox.com>
>To: <freebsd-questions@FreeBSD.ORG>
>Sent: Friday, January 25, 2002 6:18 PM
>Subject: shells confusion
>
>
> >
> > hi,
> >
> > i'm planning to learn shell programming but i'm not sure
> > on which one to choose...
> >
> > i've been reading in the 'FreeBSD unleashed' that people
> > wanting to do shell programming should stay away from
> > c-shell as it's realy good for interactive, but very bad
> > for scripts. is this true?
> >
> > also, looking into the scripts in /etc, i see a line on the
> > top saying 'bin/sh'. so are they all written in 'sh' and
> > not csh ? if so, why freebsd comes with csh as default?
> >
> > also, why single user mode proposes /bin/sh as default?
> > is there any particular reason for it?
> >
> > i'm a bit confused on which shell to pick from programming.
> > also i've been thinking of perl, but for the moment i think
> > i've got to learn at least how to do basic shell programming,
> > not only to write programs, but also to understand scrips that
> > come with the system.
> >
> > but the question is 'which shell' ...
> >
> > any advice on this matter will be appreciated.
> >
> >
> > Regards
> >
> > --Bernie
> >
> >
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7Wm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qT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-----END PGP PUBLIC KEY BLOCK-----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.0.20020126154711.049c6860>