09-29-2009
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to check the file not empty, if its not empty then i try to send other system by ftp, the following codes doesnt work
if ]
then
echo "File ${OUTBOUNDFILE} have data"
ftp -i -n -v 204.104.22.33 >> ${FTP_LOGFILE} << EOF
user abc def
ascii
put ${OUTBOUNDFILE}
quit
EOF... (1 Reply)
Discussion started by: Imran_Chennai
1 Replies
2. Shell Programming and Scripting
suppose u have a file
ABC CDF ADF FDG HAA AHH AHA
so output shud be like
"ABC" "CDF" "ADF" FDG " "HAA" "AHH" "AHA" (8 Replies)
Discussion started by: cdfd123
8 Replies
3. Shell Programming and Scripting
heya,
can someone help me with following problem.
i am not sure how far you know the catalina.sh script from tomcat. when i start my tomcat with "catalina.sh run" then the startup-process-output will be printed out on the console, but the tomcat process is started in current shell/session, so... (1 Reply)
Discussion started by: Filly
1 Replies
4. UNIX for Dummies Questions & Answers
I am passing a string as argument. Need to check if it contains "-".
If it contains "-" then check if it contains "-r" .If Yes then print some message else check if it contains "-t".If yes print some message. How this check can be done using shell script?
How I can do this by using IF OR... (7 Replies)
Discussion started by: nehagupta2008
7 Replies
5. Shell Programming and Scripting
Hi Guys,
while executing the following command : print "-ABC" is giving following error :
ksh: print: bad option(s)
I cannot use echo for some other reasons, so any other option ? (2 Replies)
Discussion started by: sagarjani
2 Replies
6. Solaris
Hi all,
First off, sorry for a long post but I think I have no other option if I need to explain properly what I need help for.
I need some advise on how best to check for "faulty" or "stalled/jammed' print queues. At the moment, I have three (3) application servers which also acts as print... (0 Replies)
Discussion started by: newbie_01
0 Replies
7. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
8. Shell Programming and Scripting
Hi Experts.
I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file.
awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename
sample data
1,abc,def,1234,A *
2,bed,dec,342,* A ... (6 Replies)
Discussion started by: shell_boy23
6 Replies
9. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
10. UNIX for Beginners Questions & Answers
When I power ON my T4-1, I got a prompt -> where I have to start /SYS and start /SP/console. How can I auto supply these two commands ? (3 Replies)
Discussion started by: z_haseeb
3 Replies
LEARN ABOUT CENTOS
spi_prepare
SPI_PREPARE(3) PostgreSQL 9.2.7 Documentation SPI_PREPARE(3)
NAME
SPI_prepare - prepare a statement, without executing it yet
SYNOPSIS
SPIPlanPtr SPI_prepare(const char * command, int nargs, Oid * argtypes)
DESCRIPTION
SPI_prepare creates and returns a prepared statement for the specified command, but doesn't execute the command. The prepared statement can
later be executed repeatedly using SPI_execute_plan.
When the same or a similar command is to be executed repeatedly, it is generally advantageous to perform parse analysis only once, and
might furthermore be advantageous to re-use an execution plan for the command. SPI_prepare converts a command string into a prepared
statement that encapsulates the results of parse analysis. The prepared statement also provides a place for caching an execution plan if it
is found that generating a custom plan for each execution is not helpful.
A prepared command can be generalized by writing parameters ($1, $2, etc.) in place of what would be constants in a normal command. The
actual values of the parameters are then specified when SPI_execute_plan is called. This allows the prepared command to be used over a
wider range of situations than would be possible without parameters.
The statement returned by SPI_prepare can be used only in the current invocation of the procedure, since SPI_finish frees memory allocated
for such a statement. But the statement can be saved for longer using the functions SPI_keepplan or SPI_saveplan.
ARGUMENTS
const char * command
command string
int nargs
number of input parameters ($1, $2, etc.)
Oid * argtypes
pointer to an array containing the OIDs of the data types of the parameters
RETURN VALUE
SPI_prepare returns a non-null pointer to an SPIPlan, which is an opaque struct representing a prepared statement. On error, NULL will be
returned, and SPI_result will be set to one of the same error codes used by SPI_execute, except that it is set to SPI_ERROR_ARGUMENT if
command is NULL, or if nargs is less than 0, or if nargs is greater than 0 and argtypes is NULL.
NOTES
If no parameters are defined, a generic plan will be created at the first use of SPI_execute_plan, and used for all subsequent executions
as well. If there are parameters, the first few uses of SPI_execute_plan will generate custom plans that are specific to the supplied
parameter values. After enough uses of the same prepared statement, SPI_execute_plan will build a generic plan, and if that is not too much
more expensive than the custom plans, it will start using the generic plan instead of re-planning each time. If this default behavior is
unsuitable, you can alter it by passing the CURSOR_OPT_GENERIC_PLAN or CURSOR_OPT_CUSTOM_PLAN flag to SPI_prepare_cursor, to force use of
generic or custom plans respectively.
This function should only be called from a connected procedure.
SPIPlanPtr is declared as a pointer to an opaque struct type in spi.h. It is unwise to try to access its contents directly, as that makes
your code much more likely to break in future revisions of PostgreSQL.
The name SPIPlanPtr is somewhat historical, since the data structure no longer necessarily contains an execution plan.
PostgreSQL 9.2.7 2014-02-17 SPI_PREPARE(3)