Try removing the semi-colon at the end of the .read statement.  The
semi-colon is the query terminator, but because dot-commands aren't
queries they don't require the semi.  As such the .read command in
twoLiner.sh is either seeing a third (and invalid) argument or an
invalid file name ("placesDump.txt ;").

   -T


On Tue, Dec 2, 2008 at 11:56 PM, Jerry Krinock <[EMAIL PROTECTED]> wrote:
>
> On 2008 Dec, 02, at 19:44, Thomas Briggs wrote:
>
>>   Put both commands (the pragma and the read) into a file (e.g.
>> foo.txt) and then do:
>>
>> sqlite3 newDatabase.sqlite '.read foo.txt'
>
> Looked like a great idea, Thomas but it doesn't work for me:
>
> jk$ echo 'PRAGMA page_size=4096 ;' > twoLiner.sh
> jk$ echo '.read placesDump.txt ;' >> twoLiner.sh
> jk$ sqlite3 places.sqlite '.read twoLiner.sh'
> unknown command or invalid arguments:  "read".
>
> The file twoLiner.sh does have the expected contents:
>
> PRAGMA page_size=4096 ;
> .read placesDump.txt ;
>
> I get the same error if I delete the PRAGMA line and just have
> the .read in the file.
>
> In the man page for sqlite3, .read will "Execute SQL in [a file]".
> The problem is probably that .read itself is a meta-command, not
> "SQL"; hence .read cannot be nested.
>
> Any other ideas?
>
> Thanks,
>
> Jerry
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to