thanks for quick reply and it is working fine and small help to assign the value to variable. it not getting output
hm.... I don't know if it's working fine or not getting output...
I asked for the output of echo "[${g_count}]" only - without |wc -l..
Please do provide the above...
Also try:
These 2 Users Gave Thanks to vgersh99 For This Post:
Hi,
My requirement is :
We are calling an sql statement from a UNIX session, and fetching data into some variables from a table .. now we are unable to access these variables from outside the SQL part. Please let me know how can I achieve this.
Can you please share a code snippet which... (4 Replies)
i'm used a sql query in a unix script to get the information from table. but unable to extract the output which i need. Any help with logic will be greatly appreciated.
my sql query provide output some thing like this -
col1 col2 count
---- ---- ------
A B 10
c D 6
e... (8 Replies)
Hi,
I am executing sql files in my unix shell script. Now i want to find whether its a success or a failure record and redirect the success or failure to the respective files. meaning.
success records to success.log file
failure record to failure.log file.
As of now i am doing like... (1 Reply)
Hello Guys,
This message is somewhat relates with last thread. But I need to re-write thing. I start over a little. I am stuck now and need your help.
Here is my script-
#! /bin/ksh
export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2
/opt/oracle/app/oracle/product/9.2/bin/sqlplus -s... (5 Replies)
Hi
I want ot save SQL query result in one txt file. for that i have written one code line
sqlplus -s $dbstring @/usr/local/bin/sched/nightly_Cronjob/exec_123.sql >> /usr/local/bin/sched/nightly_Cronjob/result.txt
but it is not working .
database : Oracle
so please advice me how can i... (7 Replies)
Hi All,
#!/bin/ksh
call_sql ()
{
sql=$1
sqlplus -s $sqlparam_sieb <<EOF
SET ECHO OFF;
SET NEWPAGE NONE;
SET SQLBL OFF;
SET VERIFY OFF;
SET LINESIZE 2000;
SET... (2 Replies)
Hi
I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query
select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p
inner join v$session se on p.addr = se.paddr
inner join
( select... (2 Replies)
Hi
iam new to shell scripting
how to declare variables as redshift query and I have to compare two counts by using if condition .
ex:count=select count(*) from prd;
select count(*) from prd;
select count(*) from tag;
can any one help me .
Please use CODE tags when displaying... (1 Reply)
I am writing the following script to create the file v_out.txt.
sqlplus -s /nolog << EOF
CONNECT scott/tiger@orcl;
whenever sqlerror exit sql.sqlcode;
set newpage 0;
SET PAGESIZE 0;
SET ECHO OFF;
SET FEEDBACK OFF;
SET HEADING OFF;
SET VERIFY OFF;
SET LINESIZE 100;
set tab off;
set... (7 Replies)
Discussion started by: itzkashi
7 Replies
LEARN ABOUT DEBIAN
mustache
MUSTACHE(1) Mustache Manual MUSTACHE(1)NAME
mustache -- Mustache processor
SYNOPSIS
mustache <YAML> <FILE>
mustache --compile <FILE>
mustache --tokens <FILE>
DESCRIPTION
Mustache is a logic-less templating system for HTML, config files, anything.
The mustache command processes a Mustache template preceded by YAML frontmatter from standard input and prints one or more documents to
standard output.
YAML frontmatter beings with --- on a single line, followed by YAML, ending with another --- on a single line, e.g.
---
names: [ {name: chris}, {name: mark}, {name: scott} ]
---
If you are unfamiliar with YAML, it is a superset of JSON. Valid JSON should work fine.
After the frontmatter should come any valid Mustache template. See mustache(5) for an overview of Mustache templates.
For example:
{{#names}}
Hi {{name}}!
{{/names}}
Now let's combine them.
$ cat data.yml
---
names: [ {name: chris}, {name: mark}, {name: scott} ]
---
$ cat template.mustache
{{#names}}
Hi {{name}}!
{{/names}}
$ cat data.yml template.mustache | mustache
Hi chris!
Hi mark!
Hi scott!
If you provide multiple YAML documents (as delimited by ---), your template will be rendered multiple times. Like a mail merge.
For example:
$ cat data.yml
---
name: chris
---
name: mark
---
name: scott
---
$ cat template.mustache
Hi {{name}}!
$ cat data.yml template.mustache | mustache
Hi chris!
Hi mark!
Hi scott!
OPTIONS
By default mustache will try to render a Mustache template using the YAML frontmatter you provide. It can do a few other things, however.
-c, --compile
Print the compiled Ruby version of a given template. This is the code that is actually used when rendering a template into a string.
Useful for debugging but only if you are familiar with Mustache's internals.
-t, --tokens
Print the tokenized form of a given Mustache template. This can be used to understand how Mustache parses a template. The tokens are
handed to a generator which compiles them into a Ruby string. Syntax errors and confused tags, therefor, can probably be identified
by examining the tokens produced.
INSTALLATION
If you have RubyGems installed:
gem install mustache
EXAMPLES
$ mustache data.yml template.mustache
$ cat data.yml | mustache - template.mustache
$ mustache -c template.mustache
$ cat <<data | ruby mustache - template.mustache
---
name: Bob
age: 30
---
data
COPYRIGHT
Mustache is Copyright (C) 2009 Chris Wanstrath
Original CTemplate by Google
SEE ALSO mustache(5), mustache(7), gem(1), http://mustache.github.com/
DEFUNKT May 2010 MUSTACHE(1)