From: deepak on
hi everyone,
I'm new to shell script.Any one please clear me the following doubts:

1) Is Shell script executes faster than a perl script?
2) How to split a string with a delimiter(eg. \t) and store in an
array in shell script.
3) How do we execute a mysql query in shell script.

thanx in advance.
From: Johann Kappacher on
deepak wrote:

> 1) Is Shell script executes faster than a perl script?
In most cases, perl uses functions instead of calling UNIX utilities.
Shell scripts depend on calling UNIX utilities because of limited
language capabilities. UNIX utilities are separate programs (=processes)
that need some time to start.

> 2) How to split a string with a delimiter(eg. \t) and store in an
> array in shell script.
This is simple stuff, please read a beginner's tutorial. You will see
enough examples. btw: String and Array manipulation is the domain of Perl.

> 3) How do we execute a mysql query in shell script.
Use mysql as a commandline utility (inside shell scripts) or use perl
-MDBD::mysql (DBI and DBD must be compiled/installed before).

--jk
From: deepak on
thanks jk
From: Johann Kappacher on
deepak wrote:
> thanks jk
This may be a starting point for you:
http://tldp.org/LDP/abs/html/arrays.html

The whole bash tutorial:
http://tldp.org/LDP/abs/html/index.html

Search for a "Learning bash" or so book.