dink

So, I was dinking around in my virtual

linux

  box last night.  Needed a little shortcut button on my home page.  Couldn't get it fingered out right away, so searched around the innertubes for a while.  Found what I needed and got it working.  (small miracles are a blessing.)

While I was surfing for my solution I came upon a whole bunch of

tutor

 ials on shell scripting.  Some dumb as hell, but a few that were really good.  For instance, I have been writing little 3-4-5 line scripts to do insanely stupid shit for a while, not knowing that you can do some really complex and complicated scripting right in the shell.  Heretofore thinking that scripting like that was reserved for

php

  or

perl

  or wtfe.

Here's the senseless part:  Given a largish text file, and the desire to manipulate the words and/or sentences from same file, and send the output to a different file; what's the diff between using sh (or csh or ksh or bash) and

perl

  or

php

 ?  Ya, I know, depends on a lot of things.  Like what you are doing at the time, what scripting engine you like, and so on.  But still:

Is there a performance hit for using one over the other?

Is there a speed issue for using one over the other?

Just curious.

perkiset

If you invoke

PHP

  or

PERL

  from the command line, you're starting another shell to handle it - so in fact, you're doing your RAM a favor by coding in the shell script.

That being said, there are nowhere near the number of functions and capabilities in shell scripting (even with the addition of tools like GREP and such) compared with a high-level lingo like

PHP

 , so it's really a choice of best tool for the job.

I personally have a bias against any language that uses "fi" to denote the end of an "if" block.  Applause

dink

I like keeping my ram happy.  So, I'll try some of the less demanding stuff from sh.

Thanx

perkiset

As a side note, there are a lot of shell scripts used to maintain a *nix system, so being conversant in shell scripting will *not* hurt you one bit D...

dink

Ya, cool and painless.  I likey.  Applause

Just tried a new one.  Kinda short, but it ought to revolutionize my way of doing things.

wget http://*.*


Perkiset's Place Home   Politics @ Perkiset's