Hello, Thank you all for help me.
My problems is solved by the code below: basexclient -U admin -P admin -L -V -v -o result.xml -c consultas.bsx >> detail.txt Regards, Daiane From: dair...@hotmail.com To: alexander.holupi...@uni-konstanz.de Subject: RE: [basex-talk] How do I create UNIX/Linux shell scripts that connect to BASEXCLIENT Date: Sat, 15 Feb 2014 16:41:11 -0200 Hello Alexander, Those tips were very helpfull, thank you. I was wondering if the content from V parameter could be saved into the result file instead just be in the screen. It is fine like this but could be better if I have the execution time also into the result.xml basexclient -U admin -P admin -L -V -o result.xml -c consultas.bsx Regards, Daiane > Subject: Re: [basex-talk] How do I create UNIX/Linux shell scripts that > connect to BASEXCLIENT > From: alexander.holupi...@uni-konstanz.de > Date: Sat, 15 Feb 2014 18:40:13 +0100 > To: dair...@hotmail.com > > % cat test.xml > <test> > <a/> > <b/> > <c/> > </test> > > % cat query.xq > db:create('test', '/Users/holu/Desktop/test.xml') > > % basexserver& > > % basexclient -U admin -P admin -L -V query.xq > > Query: > db:create('test', '/Users/holu/Desktop/test.xml') > > Parsing: 0.94 ms > Compiling: 0.04 ms > Evaluating: 16.31 ms > Printing: 0.87 ms > Total Time: 18.16 ms > > Hit(s): 0 Items > Updated: 1 Item > Printed: 0 Bytes > Read Locking: none > Write Locking: local [test] > > Query "query.xq" executed in 18.16 ms. > > % cat query-1.xq > doc('test')//b > > % basexclient -U admin -P admin -L -V -o result.xml query-1.xq > > Query: > doc('test')//b > > Compiling: > - pre-evaluating fn:doc("test") > - simplifying descendant-or-self step(s) > - converting descendant::*:b to child steps > > Optimized Query: > db:open-pre("test",0)/*:test/*:b > > Parsing: 0.37 ms > Compiling: 43.1 ms > Evaluating: 0.1 ms > Printing: 7.48 ms > Total Time: 51.04 ms > > Hit(s): 1 Item > Updated: 0 Items > Printed: 4 Bytes > Read Locking: local [test] > Write Locking: none > > Query "query-1.xq" executed in 51.04 ms. > > % cat result.xml > <b/> > > On 15.02.2014, at 18:29, DAIANE ROBERTA CANDIDA <dair...@hotmail.com> wrote: > > > Hello Alexander, > > > > Thanks for answering. > > > > I have to get the execution time from some queries. > > It will take too much time because the dataset is very large so i need to > > automatize those task. > > > > I tried get from the commands below: > > > > arwen@arwen:~/daiane_oracle/BasexQuery$ basexclient -U admin -P admin > > consultas.bsx -o result.tx 1+1 > > Stopped at /home/arwen/daiane_oracle/BasexQuery/consultas.bsx, 1/14: > > [XPST0003] Unexpected end of query: 'db_teste; > > XQUER...'. > > Dumping Java heap ... done. > > > > The problem is that if i execute the query from the command line it is ok > > and when I execute from a file it returns error. > > > > File: consultas.bsk > > --------------------------------------------------------------------------------------------------------- > > OPEN db_teste; > > XQUERY db:open('db_teste')/books/book/metadata/title [. contains text > > "usability"] > > -------------------------------------------------------------------------------------------------------- > > > > What should I do? > > > > Regards, > > > > Daiane > > > > > > > > > Subject: Re: [basex-talk] How do I create UNIX/Linux shell scripts that > > > connect to BASEXCLIENT > > > From: alexander.holupi...@uni-konstanz.de > > > Date: Sat, 15 Feb 2014 18:02:53 +0100 > > > CC: basex-talk@mailman.uni-konstanz.de > > > To: dair...@hotmail.com > > > > > > Hi Daiane, > > > > > > Start server: > > > > > > $ basexserver & > > > > > > Use client to connect, execute query and store result in file: > > > > > > $ basexclient -U admin -P admin -o result.tx 1+1 > > > $ cat result.txt > > > 2 > > > > > > Doing stuff like that from within a shell script should be no problem. > > > Are there any specific issues you are facing? > > > > > > Alex > > > > > > On 15.02.2014, at 17:57, DAIANE ROBERTA CANDIDA <dair...@hotmail.com> > > > wrote: > > > > > > > Hello, > > > > > > > > I want to create a Shell script to connect basexclient, running queries > > > > and put the output into a file. > > > > > > > > How can I do that? > > > > > > > > > > > > Regards, > > > > > > > > Daiane > > > > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Dr. Alexander Holupirek > |-- Room E 221, 0049 7531 88 2188 (phone) 3577 (fax) > |-- Database & Information Systems Group, U Konstanz > `-- https://scikon.uni-konstanz.de/personen/alexander.holupirek/ > > >
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk