Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


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

bash scripting




>And therin lies one of the explanations for the
>slowness of shell scripts: A test involves forking
>a subprocess.
>
>This doesn't matter for most 5-line scripts, but
>it's part of why it's nice to have real programming
>languages like perl or tcl or python for when you
>want your script to do something non-trivial.
>
>(I've heard rumors that some versions of some shells
>do the test as a builtin, but I've had trouble
>verifying this.  I know that the original Bourne
>shell did use subprocesses for tests, and I've seen
>vague comments that this is still more common than
>you might expect a quarter century later.)


The rumours are true; since certain aspects of (or related
to) shell programming are now "carved in stone" by virtue
of being spelled out in POSIX, they were deemed stable
enough to implement as built-ins to some shells rather than
needing always to be forked/exec'd as standalone progs,
though the standalone versions of "verbs" like echo and
test will probably still be kicking around in /bin long
after we're all dead.

BTW, I use bash scripts a LOT in my work, and quite
productively, but please, let's not reopen that my-approach-
to-scripting-is-better-than-yours can'o'worms since it's
already been firmly established that Visual Basic is the
hands-down, undisputed winner, with Forth being a close
second and all other contenders left in the dust...  ;->

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org