> On Sat, May 31, 2008 at 9:48 PM, Bruce Robertson <[EMAIL PROTECTED]> wrote:
>> Here's a more basic example. This is really just a shell script formatting
>> problem and it must be really simple. I'm trying to use \n as new line. The
>> result I want from the echo statement is as follows but I can't figure out
>> how to set x to get there.
>> 
>> A
>> B
>> C
>> D
>> 
>> 
>> set x="A\nB\nC\nD"; echo $x
> 
> $ x="A\nB\nC\nD"; echo -e $x
> A
> B
> C
> D

Excellent, I knew it was something simple.

Now one odd problem.

When \n is properly substituted, this all works fine EXCEPT for the select
statement.

There the "*" is somehow seen as though it was asking for a directory. If I
change the "*" to a valid field name, I get correct results.

Command string:

x=".read /a.sql 
.schema
.tables
select * from Responses;
.dump
"; echo -e $x |sqlite3 :memory:
    
Result:

CREATE TABLE Responses (GFUP_ID TEXT,FullQNum TEXT,ResponseNumber
TEXT,SurveyVersion TEXT,RecordID TEXT);
Responses
select Applications Desktop DB Desktop DF Developer Documents
LassoImageMagick.6 Library MyTestDatabase.sqlite Network PDF Resp.mer System
User Guides And Information Users Volumes a.db a.sql a.tab a.txt a1.db aa.db
aa.sqlite ab.db ab.txt adb.txt automount b.txt b2.txt bin c.txt cores d.sql
db.sql db2.db db2.sql dev dump.sqlite etc mach mach.sym mach_kernel
mydata.db mydata.db
 mydata.db
.mode mydata.db.zip opt private resp.db sbin sort tmp usr var x.db from
MemoryDB.Responses;
SQL error: near "DB": syntax error
BEGIN TRANSACTION;
CREATE TABLE Responses (GFUP_ID TEXT,FullQNum TEXT,ResponseNumber
TEXT,SurveyVersion TEXT,RecordID TEXT);
INSERT INTO "Responses" VALUES('36780001', '00.1.01', '1', '2000', '1');
INSERT INTO "Responses" VALUES('36780001', '02.1.01', '1', '2000', '2');
INSERT INTO "Responses" VALUES('36780001', '02.1.02', '', '2000', '3');
INSERT INTO "Responses" VALUES('36780001', '02.1.03', '', '2000', '4');

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to