Re: msqlImport

From: Trev Roydhouse (trev@sentry.org)
Date: Sat Dec 04 1999 - 21:12:28 EST


Per Johansson wrote:
>
> ** Reply to message from Trev Roydhouse <trev@sentry.org> on Fri, 03 Dec 1999
> 15:00:42 +1100
>
> >
> >
> > ./msqlimport -s \" testdb employee < t.in
> >
> > works for me under FreeBSD.
> >
>
> Thanks, good idea...
>
> This one works locally, but it won't read directly from <file :
> msqlimport -s ; -v -q \"
>
> This one works on the Linux server *and* reads from <file :
> /usr/local/msql/bin/msqlimport -v -q \"
>
> This one doesn't work at all:
> /usr/local/msql/bin/msqlimport -s ; -v -q \"
>
> However, I can use comma as separator, the quotation marks take care of hiding
> commas inside the fields. The only problem is that it seems to duplicate fields
> if one is empty...

Sorry, I should have been more explicit. The reason it does not work is
that your command shell is interpreting the characters before they reach
the program. You need to escape the semicolon as well as the quotation
mark, otherwise your command line with the semicolon is interpreted as
two separate commands: one being 'msqlimport -s' and the other being '-v
-q \"'.

For example, the command line 'echo 1 ; echo 2' produces
1
2
and 'echo 1 ; 2' produces
1
2: Command not found.
but 'echo 1 \; 2' produces
1 ; 2

TREV.

-- 
Trevor Roydhouse   BJuris, LLB      Tel: +61-2-9857-1451 (24hrs)
Electronic Product Developer        Fax: +61-2-9857-1605 (work)
CCH Australia Limited                    +61-2-9428-3430 (home)
-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/



This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:04:03 EST