spliting a string.

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.
deepak [ So, 06 April 2008 18:28 ] [ ID #1936440 ]

Re: spliting a string.

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
Johann Kappacher [ So, 06 April 2008 18:48 ] [ ID #1936443 ]

Re: spliting a string.

thanks jk
deepak [ Mo, 07 April 2008 08:52 ] [ ID #1936881 ]

Re: spliting a string.

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.
Johann Kappacher [ Mo, 07 April 2008 23:23 ] [ ID #1936911 ]
Linux » comp.unix.shell » spliting a string.

Vorheriges Thema: parsing-bash shell-awk
Nächstes Thema: mv or something else