[nycbug-talk] Shell Newbie

Scott Robbins scottro at nyc.rr.com
Wed Apr 12 10:19:28 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Apr 12, 2006 at 09:58:11AM -0400, Huy Ton That wrote:
> Hey all, I've always used the bash shell and wanted to get into some shell
> scripting.  Before I started, I curious to see if anyone had any feedback as
> far as other shells are out there and just get a feel for the general
> preference if any exists; speaking purely for flexibility.

Heh, no doubt you'll get a great many answers.  I would say, however, do
your best to use sh rather than bash, simply for portability.  On Linux,
most of the time, /bin/sh is a link to /bin/bash.  However, on the BSDs
and other Unix and Unix like systems, /bin/sh might be all you have.  

So, if you write a script with the top line of 

#!/bin/bash

You'd have to modify it for FreeBSD to #!/usr/local/bin/bash and on
NetBSD to #!/usr/pkg/bin/bash and the like.

Bash has a few features that sh lacks, such as the select loop, but,
especially when you're just beginning, you can probably do most of what
you want in sh.  

(I use zsh myself, but for scripts, I use sh.)




- -- 

Scott

GPG KeyID EB3467D6
( 1B848 077D 66F6 9DB0 FDC2  A409 FA54 D575 EB34 67D6)
gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

Principal Snyder: There are things I will not tolerate: students 
loitering on campus after school, horrible murders with hearts 
being removed. And also smoking. 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFEPQxw+lTVdes0Z9YRAh9BAJ9M4/yxmlGCsqye0if6vAUiKnI3EgCfb7h/
bwtIEyzVxKUQduyMfcGWzD8=
=833y
-----END PGP SIGNATURE-----



More information about the talk mailing list