Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Peng Yu
On Thu, Jun 24, 2010 at 9:19 AM, Eric Smith wrote: > Peng Yu wrote: > >> On Thu, Jun 24, 2010 at 5:05 AM, Simon Slavin wrote: >> > >> > On 24 Jun 2010, at 4:50am, Peng Yu wrote: >> > >> >> Is there a way to use Shebang for sqlite3 script? >> >> >> >>

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Jay A. Kreibich
On Thu, Jun 24, 2010 at 10:36:20AM -0400, Pavel Ivanov scratched on the wall: > > I was asking whether it is possible to use Shebang with sqlite script. > > If it is possible, would you please show me how to modify the > > following script to do so? > > If you don't mind one error message then

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Simon Slavin
On 24 Jun 2010, at 3:13pm, Peng Yu wrote: > I was asking whether it is possible to use Shebang with sqlite script. > If it is possible, would you please show me how to modify the > following script to do so? > > $ ./main.sql > Error: unknown command or invalid arguments: "/main.sql". Enter >

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Pavel Ivanov
> I was asking whether it is possible to use Shebang with sqlite script. > If it is possible, would you please show me how to modify the > following script to do so? If you don't mind one error message then you can do it like this: > cat test.sql #!/usr/bin/sqlite3 -init ; create table tbl1(one

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Jay A. Kreibich
On Thu, Jun 24, 2010 at 09:13:01AM -0500, Peng Yu scratched on the wall: > I was asking whether it is possible to use Shebang with sqlite script. > If it is possible, would you please show me how to modify the > following script to do so? Not possible. Shebang assumes the input file can be

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Eric Smith
Peng Yu wrote: > On Thu, Jun 24, 2010 at 5:05 AM, Simon Slavin wrote: > > > > On 24 Jun 2010, at 4:50am, Peng Yu wrote: > > > >> Is there a way to use Shebang for sqlite3 script? > >> > >> http://en.wikipedia.org/wiki/Shebang_%28Unix%29 > > > > SQLite comes with a

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Peng Yu
On Thu, Jun 24, 2010 at 5:05 AM, Simon Slavin wrote: > > On 24 Jun 2010, at 4:50am, Peng Yu wrote: > >> Is there a way to use Shebang for sqlite3 script? >> >> http://en.wikipedia.org/wiki/Shebang_%28Unix%29 > > SQLite comes with a command-line tool.  You can feed it with

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-24 Thread Simon Slavin
On 24 Jun 2010, at 4:50am, Peng Yu wrote: > Is there a way to use Shebang for sqlite3 script? > > http://en.wikipedia.org/wiki/Shebang_%28Unix%29 SQLite comes with a command-line tool. You can feed it with individual commands on a Unix command-line or tell it to read commands from a file.

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/23/2010 08:50 PM, Peng Yu wrote: > Is there a way to use Shebang for sqlite3 script? What happened when you tried it? Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla -

Re: [sqlite] How accept sqlite3 commands from stdin

2010-06-23 Thread Peng Yu
On Tue, May 25, 2010 at 3:25 PM, Black, Michael (IS) wrote: > sqlite3 main.db < main.txt > > or > cat main.txt | sqlite3 main.db > > or > > echo "create table tbl1(one varchar(10), two smallint);" | sqlite3 main.db Is there a way to use Shebang for sqlite3 script?

Re: [sqlite] How accept sqlite3 commands from stdin

2010-05-25 Thread Black, Michael (IS)
sqlite3 main.db < main.txt or cat main.txt | sqlite3 main.db or echo "create table tbl1(one varchar(10), two smallint);" | sqlite3 main.db Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on