Sponsored Content
Operating Systems Linux How to store count of multiple queries in variables in a shell script? Post 302886357 by sanvel on Friday 31st of January 2014 12:38:46 AM
Old 01-31-2014
How to store count of multiple queries in variables in a shell script?

how to store the count of queries in variables inside a filein shell script

my output :

filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to store query multiple result in shell script variable(Array)

:) Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable. like #!/bin/ksh v_shell_var=Hi here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array). Regards, Div (4 Replies)
Discussion started by: div_Neev
4 Replies

2. Shell Programming and Scripting

How to store contents of a command in array of variables in shell script?

I want to store contents of command dir in array of variables For eg: dir contents are command d2 demovi~ file inven java new untitled folder d1 demovi er1 filename inven~ myfiles ubuntu desktop xmms ----------------------------------- I... (3 Replies)
Discussion started by: netresearch
3 Replies

3. Shell Programming and Scripting

Multiple MySql queries in shell script?

Hi guys, i know how to run a single query using mysql embedded in a shell script as follows: `mysql -umyuser -pmypass --host myhost database<<SQL ${query}; quit SQL` However, how would i be able to run several queries within the same connection? The reason for this is i am creating... (3 Replies)
Discussion started by: muay_tb
3 Replies

4. Shell Programming and Scripting

store multiple variables in one go

Guys anyone know how i can store fields into multiple variables in one go? I'm wanting to grab the disk id's from format into disk1 and disk2 Below is what i want to work but i know it doesnt :- : | format | awk '/^(\ +)/ {print $2}' | read disk1 disk2 The below does work...but i don't... (5 Replies)
Discussion started by: lavascript
5 Replies

5. Shell Programming and Scripting

count multiple objects in shell script

Hi all: Trying to count the number of oracle instances on HPUX 11.23 - using ksh. I have multiple instances running and I would like to have a count for how many processes for each instance. Example, run the 'ps -efu oracle' command and for each instance increment a counter. So I am looking for... (4 Replies)
Discussion started by: raggmopp
4 Replies

6. Shell Programming and Scripting

Shell Script to store contents of multiple files into one

Hi, I"m writing a script to store all the contents of multiple files with different file names into one single file. I am giving in only last modified date of file in a folder. The below script gives a list of just one file based on the input date i give which is taken as string variable. I... (2 Replies)
Discussion started by: ashrocks
2 Replies

7. Shell Programming and Scripting

How to store results of multiple sql queries in shell variables in ksh?

Hi, I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else. Thanks in advance.. Cheers (6 Replies)
Discussion started by: gonchusirsa
6 Replies

8. Shell Programming and Scripting

Executing Multiple Queries in parallel in Shell

I have n number of SQL queries needs to executed in Shell. Result of this query need to assign in a variable. Once all the queries are executed script needs to exit. Sample Query: SQL 1: Select Count(*) from TABLE GROUP BY COL1,COL2 SQL 2: Select Count(*) from TABLE GROUP BY COL1,COL2 ... (2 Replies)
Discussion started by: Niranjancse
2 Replies

9. Shell Programming and Scripting

Shell script to read a file and store in variables

I have a input file like this. Sample.txt 30 | TXDatacenter | TXBackupDC 10 | UKDatacenter | UKBackupDC 0 | NLDatacenter | NLBackupDC ...... ...... ...... I need to get these values in different variables like this. Load1=30 PriCenter1=TXDatacenter... (5 Replies)
Discussion started by: Visha
5 Replies

10. Shell Programming and Scripting

Shell script count lines and sum numbers from multiple files

I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines: It counts the number of lines: egrep -i String file_name_201611* |... (5 Replies)
Discussion started by: Elly
5 Replies
4S-QUERY(1J)							      4store							      4S-QUERY(1J)

NAME
4s-query -- Run SPARQL queries on a 4store storage backend SYNOPSIS
4s-query kb-name [-f format] [-O optimisation-level] [-I insert-mode] [-r] [-s soft-limit] [-b base-URI] [-e] [-P] [query] -f Set the format to output results it, options are "sparql", "text", "json", and "testcase" -O, --opt-level Set the optimisation level of the query engine, in the range 0-3. -I, --insert Treat CONSTRUCT statements as INSERT statements. This feature is highly experimental and largly untested. -r, --restricted Enable query complexity restriction mode -s, --soft-limit Override default soft limit on search breadth -d, --default-graph Enable SPARQL default graph support -b, --base Set base URI for queries -e, --explain Return an explanation of the query planner's descisions -P Enable programatic IO mode INTERACTIVE MODE
If [query] is ommited then 4s-query goes into interactive mode, suitable for trying queries from the command line. -P enables programatic interactive mode, suitable for infacing with processes via stdin and stdout. Queries are sent as UTF-8 bytes, termi- nated with "#EOQ" on a line of it's own, results are returned, ending with "#EOR". Interacting with 4store in this way is more efficient than using the SPARQL protocol, but non-standard. SEE ALSO
4s-import(1), 4s-httpd(1), 4s-backend(1), 4s-delete-model(1) STANDARDS
4s-query implements the SPARQL Query Language specification (aka. SPARQL/Query 1.0) and the SPARQL Result Format specification (aka. SPARQL/Results 1.0). Default graph support is no normally enabled, the --default-graph turns it on, as does speicfying FROM <default:> in the query. Data loaded with $ 4s-import kb --add -m default: uri/filename will be added to the default graph. EXAMPLES
$ 4s-query -f sparql demo 'SELECT * WHERE { ?s ?p ?s } LIMIT 10' Return 10 random triples from the knowledgebase "demo" in the SPARQL XML result format. $ 4s-query -P demo < query.rq Run the query in query.rq and output the result to stdout 4store May 31, 2019 4store
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy