I have 2 scripts: script1 and script2
Script1 passes 4 parameters to script2 as follows
#script1
code
...
...
script2 $var1 $var2 $var3 $var4
Script2 uses the export command to know to expect these values
#script2
export $1 $2 $3 $4
code
...
...
The problem that I am having is... (1 Reply)
I have created a script "myscript.sh"
I need to run this script with diffrent parameters.
The parameters are stored in a file myparam.txt.
I need to run myscript.sh script for every parameter supplied in myparam.txt.
Example:
If myparam.txt contains following lines:
param1
param2
param3... (3 Replies)
hi,
i am passing around 14 parameters for a script
a=$1
b=$2
c=$3
d=$4
e=$5
f=$6
g=$7
h=$8
i=\"${9}\"
shift
j=\"${1}\"
still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
I am writing a script that should read the csv file and pass the values in the file as parameters
to the script. The csv file looks like this:
TEST_1,20110221
TEST_2,20110220
TEST_3,20110218,20110219
Currently this is how i am running the script
./test.sh <param1> <date>
Ex: ./test.sh... (6 Replies)
Hi All,
I am new to shell scripting required some help in passing the parameter value to the shell script.
I am writing a shell script, in the script I have created two functions as below.
first function
get_trend_ids () {
Here I am connecting to the database and getting all the... (3 Replies)
Hi All,
I have written a shell script and the script is working fine, I am passing my MIT_ID(NUMBER VALUE) to the shell script from the command prompt and my script is executing as expected.
Now I have to pass all the MIT_ID's from a .txt file to the shell script,as I am automating this I... (6 Replies)
how can i make a script to run only when parameters are given,
if parameters are not given it should through an error , saying "please enter a parameter"
for ex: i want a find command to run only when the parameters are given (4 Replies)
I have a script that uses more than one parameter. It looks like this:
for i in `cat /tmp/listofpolicies`;
do
for x in $(cat /tmp/lst |sed 's/^/\/usr\/openv\/netbackup\/db\/class\//g');
do /usr/openv/netbackup/bin/admincmd/bpplinclude $i -delete -f $x;done;done
The problem is that the... (3 Replies)
Hello Experts,
I have a requirement to pass some parameters to Linux cron tab.
For ex: My default cron entry looks like this as below:
-------------------------------
55 10 * * --... (7 Replies)
Hello Everyone,
I have developed a shell script which takes schema id and password as parameter to login into database using sqlplus,runs a query and mails the result.
My requirement is that, I dont want to pass userid and password as parameters.Instead,I want to pass say Environment... (4 Replies)
Discussion started by: karthik adiga
4 Replies
LEARN ABOUT CENTOS
spi_execute_with_args
SPI_EXECUTE_WITH_ARGS(3) PostgreSQL 9.2.7 Documentation SPI_EXECUTE_WITH_ARGS(3)NAME
SPI_execute_with_args - execute a command with out-of-line parameters
SYNOPSIS
int SPI_execute_with_args(const char *command,
int nargs, Oid *argtypes,
Datum *values, const char *nulls,
bool read_only, long count)
DESCRIPTION
SPI_execute_with_args executes a command that might include references to externally supplied parameters. The command text refers to a
parameter as $n, and the call specifies data types and values for each such symbol. read_only and count have the same interpretation as in
SPI_execute.
The main advantage of this routine compared to SPI_execute is that data values can be inserted into the command without tedious
quoting/escaping, and thus with much less risk of SQL-injection attacks.
Similar results can be achieved with SPI_prepare followed by SPI_execute_plan; however, when using this function the query plan is always
customized to the specific parameter values provided. For one-time query execution, this function should be preferred. If the same command
is to be executed with many different parameters, either method might be faster, depending on the cost of re-planning versus the benefit of
custom plans.
ARGUMENTS
const char * command
command string
int nargs
number of input parameters ($1, $2, etc.)
Oid * argtypes
an array containing the OIDs of the data types of the parameters
Datum * values
an array of actual parameter values
const char * nulls
an array describing which parameters are null
If nulls is NULL then SPI_execute_with_args assumes that no parameters are null.
bool read_only
true for read-only execution
long count
maximum number of rows to return, or 0 for no limit
RETURN VALUE
The return value is the same as for SPI_execute.
SPI_processed and SPI_tuptable are set as in SPI_execute if successful.
PostgreSQL 9.2.7 2014-02-17 SPI_EXECUTE_WITH_ARGS(3)