Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Kees Nuyt
On Wed, 6 May 2009 23:24:00 +0200, Daniel Wolny wrote: >2009/5/6 Kees Nuyt : >> On Wed, 6 May 2009 23:01:24 +0200, Daniel Wolny >> wrote: >> It should be possible, sqlite sends its output to stdout, so >> it works like any other unix utility. >> >> Just give it a go. Experiment. >> And enjoy. >>

Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Pavel Ivanov
You should do for i in $HANDLER Notice: NO quotes. Though be careful - it will not work if row contains text field with spaces. Pavel On Wed, May 6, 2009 at 5:24 PM, Daniel Wolny wrote: > 2009/5/6 Kees Nuyt : >> On Wed, 6 May 2009 23:01:24 +0200, Daniel Wolny >> wrote: >> It should be possibl

Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Daniel Wolny
2009/5/6 Kees Nuyt : > On Wed, 6 May 2009 23:01:24 +0200, Daniel Wolny > wrote: > It should be possible, sqlite sends its output to stdout, so > it works like any other unix utility. > > Just give it a go. Experiment. > And enjoy. > It doesn't work to me: #!/bin/sh HANDLER=`sqlite -noheader /ro

Re: [sqlite] sqlite in shell loop

2009-05-06 Thread Kees Nuyt
On Wed, 6 May 2009 23:01:24 +0200, Daniel Wolny wrote: >Hi, >Is possible to use sqlite in shell for loop? > >eg. >#!/bin/sh > >for i in `sqlite db "SELECT smt FROM db"` >do > echo "$i" DUPA >done > >I want to act sqlite like any other command in for loop, i mean one >record from db as a one

[sqlite] sqlite in shell loop

2009-05-06 Thread Daniel Wolny
Hi, Is possible to use sqlite in shell for loop? eg. #!/bin/sh for i in `sqlite db "SELECT smt FROM db"` do echo "$i" DUPA done I want to act sqlite like any other command in for loop, i mean one record from db as a one iteration, above will display: first1 first2 second1 second2 DUPA I