hi guys,
my ksh script is calling another script. The other script expects user to press CNTR-C, and does not return to the prompt.
in my script, I want to call the other script, but somehow don't want it to wait forever, I want to return to my script.
e.g.
script2.ksh outputs:
"No... (2 Replies)
Hi all,
I'm trying to run an sql inside a loop which looks like this
#!bin/ksh
while IFS=, read var1 var2
do
sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << EOF
insert into ${TABLE}
(
appt_date
)
values
(
'${var1 }'
);
... (6 Replies)
Shell Scipt: temp.sh
su - <$username>
expect pass.exp
Expect script: pass.exp
#!/usr/bin/expect -f
# Login
#######################
expect "Password: " send "<$password>\r"
it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
:oi was trying to write a script to format output of a command in ksh which has output as below:
so i used :
to get
which i require at all times. But problem occurs when status part changes. above output i get when status is SU (success).If the status is IN (inactive), output of... (1 Reply)
Hello,
If i run the following script from the cmdline it works just fine however if i run it via root cronjob it doesn't write to the file at all. It is chmod 777 now so shouldnt be any right issues.
Shellscript looks like this:
/usr/bin/top -b -n 1 -u nagios >> /var/log/test.log
Cronjob... (7 Replies)
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Hi,
I have a text file, which I am trying to parse.
File contents:
BEG
Id Job1
Id Stage1
1
EN
Id Job2
Id Stage2
BEG
Id2 Job3
Id Stage4
2
EN
I have to process the data in this between every BEG and EN. so I am trying to restrict the range and inside every... (1 Reply)
I am trying to execute expect command inside by small bash script to login into servers using key authentication method. My script is as follows:
#!/bin/bash
HOST=$1
/usr/bin/expect -c "
spawn ssh -i /root/.ssh/id_rsa root@$HOST
expect -exact "Enter... (3 Replies)
I am new at scripting. I have a file that each line is the shortname for a server.
ie -
Server1
Server2
Server3
I want to read in that file, do a nslookup and print the FQDN to a file.
I added an echo statement to make sure my variable was being read and changing. But the nslookup... (5 Replies)
Discussion started by: kellyhkc
5 Replies
LEARN ABOUT PHP
cubrid_next_result
CUBRID_NEXT_RESULT(3) 1 CUBRID_NEXT_RESULT(3)cubrid_next_result - Get result of next query when executing multiple SQL statementsSYNOPSIS
bool cubrid_next_result (resource $result)
DESCRIPTION
The cubrid_next_result(3) function is used to get results of next query if multiple SQL statements are executed and CUBRID_EXEC_QUERY_ALL
flag is set upon cubrid_execute(3).
PARAMETERS
o $result
-$result comes from a call to cubrid_execute(3)RETURN VALUES
TRUE, when process is successful.
FALSE, when process is unsuccessful.
EXAMPLES
Example #1
cubrid_next_result(3) example
<?php
$conn = cubrid_connect("127.0.0.1", 33000, "demodb", "dba");
$sql_stmt = "SELECT * FROM code; SELECT * FROM history WHERE host_year=2004 AND event_code=20281";
$res = cubrid_execute($conn, $sql_stmt, CUBRID_EXEC_QUERY_ALL);
get_result_info($res);
cubrid_next_result($res);
get_result_info($res);
function get_result_info($req)
{
printf("
------------ get_result_info --------------------
");
$row_num = cubrid_num_rows($req);
$col_num = cubrid_num_cols($req);
$column_name_list = cubrid_column_names($req);
$column_type_list = cubrid_column_types($req);
$column_last_name = cubrid_field_name($req, $col_num - 1);
$column_last_table = cubrid_field_table($req, $col_num - 1);
$column_last_type = cubrid_field_type($req, $col_num - 1);
$column_last_len = cubrid_field_len($req, $col_num - 1);
$column_1_flags = cubrid_field_flags($req, 1);
printf("%-30s %d
", "Row count:", $row_num);
printf("%-30s %d
", "Column count:", $col_num);
printf("
");
printf("%-30s %-30s %-15s
", "Column Names", "Column Types", "Column Len");
printf("------------------------------------------------------------------------------
");
$size = count($column_name_list);
for($i = 0; $i < $size; $i++) {
$column_len = cubrid_field_len($req, $i);
printf("%-30s %-30s %-15s
", $column_name_list[$i], $column_type_list[$i], $column_len);
}
printf("
");
printf("%-30s %s
", "Last Column Name:", $column_last_name);
printf("%-30s %s
", "Last Column Table:", $column_last_table);
printf("%-30s %s
", "Last Column Type:", $column_last_type);
printf("%-30s %d
", "Last Column Len:", $column_last_len);
printf("%-30s %s
", "Second Column Flags:", $column_1_flags);
printf("
");
}
?>
The above example will output:
------------ get_result_info --------------------
Row count: 6
Column count: 2
Column Names Column Types Column Len
------------------------------------------------------------------------------
s_name char 1
f_name varchar 6
Last Column Name: f_name
Last Column Table: code
Last Column Type: varchar
Last Column Len: 6
Second Column Flags:
------------ get_result_info --------------------
Row count: 4
Column count: 5
Column Names Column Types Column Len
------------------------------------------------------------------------------
event_code integer 11
athlete varchar 40
host_year integer 11
score varchar 10
unit varchar 5
Last Column Name: unit
Last Column Table: history
Last Column Type: varchar
Last Column Len: 5
Second Column Flags: not_null primary_key unique_key
SEE ALSO cubrid_execute(3).
PHP Documentation Group CUBRID_NEXT_RESULT(3)