zsh-users
 help / color / mirror / code / Atom feed
* Using a shell database
@ 2005-11-14 12:41 zzapper
  2005-11-14 16:40 ` Ian Langworth
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: zzapper @ 2005-11-14 12:41 UTC (permalink / raw)
  To: zsh-users

Hi,
I have shell utility which stores information (between sessions) in a series of text files. I now
want to do something more complicated, and realise I should be considering using a database.
I then ran smack into a steep learning curve.
Is there a shell accessible database? gdbm?
Pointers please, examples if possible

(I realise this thread may not be particularly zshish)

-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-14 12:41 Using a shell database zzapper
@ 2005-11-14 16:40 ` Ian Langworth
  2005-11-15 11:05   ` zzapper
  2005-11-14 20:51 ` Marc Chantreux
  2005-11-15 18:32 ` Clint Adams
  2 siblings, 1 reply; 8+ messages in thread
From: Ian Langworth @ 2005-11-14 16:40 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On 11/14/05, zzapper <david@tvis.co.uk> wrote:

> I have shell utility which stores information (between sessions) in a series of text files. I now
> want to do something more complicated, and realise I should be considering using a database.
> I then ran smack into a steep learning curve.
> Is there a shell accessible database? gdbm?
> Pointers please, examples if possible

You don't want to bring databases into your shell script. You want to
begin to use a tool that's better-suited for the job, like Perl,
Python or Ruby.

--
Ian Langworth


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-14 12:41 Using a shell database zzapper
  2005-11-14 16:40 ` Ian Langworth
@ 2005-11-14 20:51 ` Marc Chantreux
  2005-11-15 18:32 ` Clint Adams
  2 siblings, 0 replies; 8+ messages in thread
From: Marc Chantreux @ 2005-11-14 20:51 UTC (permalink / raw)
  To: zsh-users

is sqlite for you ?

http://sqlite.org/

regards
mc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-14 16:40 ` Ian Langworth
@ 2005-11-15 11:05   ` zzapper
  2005-11-15 12:12     ` Marc Chantreux
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-11-15 11:05 UTC (permalink / raw)
  To: zsh-users

On Mon, 14 Nov 2005 11:40:26 -0500,  wrote:

>On 11/14/05, zzapper <david@tvis.co.uk> wrote:
>
>> I have shell utility which stores information (between sessions) in a series of text files. I now
>> want to do something more complicated, and realise I should be considering using a database.
>> I then ran smack into a steep learning curve.
>> Is there a shell accessible database? gdbm?
>> Pointers please, examples if possible
>
>You don't want to bring databases into your shell script. You want to
>begin to use a tool that's better-suited for the job, like Perl,
>Python or Ruby.

Thanx for both replies, it would seem my requirement has crossed the invisible shell/application
boundary.I realise now that shells don't have a database I hoped there might be a real simple
"pairs" application.

I did have a phase of writing all my "scripts" in Perl, but noticed that they were much slower than
their equivalent shell scripts.

Any comments from the zsh maestros?
-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-15 11:05   ` zzapper
@ 2005-11-15 12:12     ` Marc Chantreux
  2005-11-15 12:19       ` zzapper
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Chantreux @ 2005-11-15 12:12 UTC (permalink / raw)
  Cc: zsh-users

zzapper wrote:

> I did have a phase of writing all my "scripts" in Perl, but noticed that they were much slower than
> their equivalent shell scripts.


it depends of a lot of parameters. I use perl when perl makes thinks a 
lot easier or when there is a lot of content to parse.

if you can read french, i've done my own benches and my conclusion is 
here : http://khatar.phear.org/shell/bench.html.


regards
mc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-15 12:12     ` Marc Chantreux
@ 2005-11-15 12:19       ` zzapper
  2005-11-15 13:27         ` Marc Chantreux
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-11-15 12:19 UTC (permalink / raw)
  To: zsh-users

On Tue, 15 Nov 2005 13:12:24 +0100,  wrote:

>zzapper wrote:
>
>> I did have a phase of writing all my "scripts" in Perl, but noticed that they were much slower than
>> their equivalent shell scripts.
>
>
>it depends of a lot of parameters. I use perl when perl makes thinks a 
>lot easier or when there is a lot of content to parse.
>
>if you can read french, i've done my own benches and my conclusion is 
>here : http://khatar.phear.org/shell/bench.html.
>
Mc,
Your benchmark shows zsh being 10X quicker than Perl, that would be the order of difference that I
noticed.
I also have some shells that call perl (to complicate matters!)

-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-15 12:19       ` zzapper
@ 2005-11-15 13:27         ` Marc Chantreux
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Chantreux @ 2005-11-15 13:27 UTC (permalink / raw)
  To: zsh-users

zzapper wrote:

> Mc,
> Your benchmark shows zsh being 10X quicker than Perl, that would be the order of difference that I
> noticed.

As my conclusion says (sorryn it's in french), it will only be true with 
few content to process : perl compute things very faster than shell. In 
this benchmark, perl is slower because you have to launch a huge binary 
(perl interpreter) to execute a very small task.

regards
mc


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Using a shell database
  2005-11-14 12:41 Using a shell database zzapper
  2005-11-14 16:40 ` Ian Langworth
  2005-11-14 20:51 ` Marc Chantreux
@ 2005-11-15 18:32 ` Clint Adams
  2 siblings, 0 replies; 8+ messages in thread
From: Clint Adams @ 2005-11-15 18:32 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

> I have shell utility which stores information (between sessions) in a series of text files. I now
> want to do something more complicated, and realise I should be considering using a database.
> I then ran smack into a steep learning curve.
> Is there a shell accessible database? gdbm?

There have been vague plans for zsh database modules for a long time,
but they've been stalled by other issues.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-15 18:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-14 12:41 Using a shell database zzapper
2005-11-14 16:40 ` Ian Langworth
2005-11-15 11:05   ` zzapper
2005-11-15 12:12     ` Marc Chantreux
2005-11-15 12:19       ` zzapper
2005-11-15 13:27         ` Marc Chantreux
2005-11-14 20:51 ` Marc Chantreux
2005-11-15 18:32 ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).