I'm trying to write a ksh script that uses awk, but I want to pass variables to awk. For example (not working):
if ];then
searchstr=$1
lsof -i | awk '{if($9~/SEARCHSTR/) print $2} SEARCHSTR=$searchstr'
else
echo "usage: $0 <search string>"
fi
I tried several options. Is it... (3 Replies)
Hi,
I have a scenario where in i have to extarct max of one column and pass it to a variable.
i have tried to export the result as .dat file and read from that file.But my database is mainframe and it is not permitting me to export in .dat file.I have tried using .ixf file but reading from... (2 Replies)
Hi,
I have a file input which has 1000 data inputs of array elements.
I would like to pass this to a C program one line at a time as input automatically. Anyone know how I could use "sed" to perform this?
Appreciate alot. Thanks. (1 Reply)
Passing a array to a function, a basic feature in modern language, seems to be only possible in KSH. Not in BASH. Depite all my efforts I couldn't come to a solution. See the following examples:
It works perfectly in KSH:
#!/usr/bin/ksh
function print_array {
# assign array by indirect... (3 Replies)
Hi,
I have a function that hold 3 arrayies.
I need to pass them to another function as an input, for further use
Could you please explain how to do that.
Thanks (5 Replies)
Hi there,
I am trying to call a shell script from a Perl script. here is the code:
@args = ("sh", "someshellprg.sh", "a file handler", "an array");
system(@args) == 0
or die "system @args failed: $?";
in the shell program, I examine if the arguments exits using:
if
then echo... (5 Replies)
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
hi team,
i have a file, which contains only variable and its value
param.ksh
---------
export A=123
export B=345
export C=567
export D=OPLI
export E=OL89PO
From shell script, i am invoking this file and use the value of this variable. Now there are 5 variable in above file. Before i... (1 Reply)
I'm reading a text file using a while loop but when I call a function from within this loop it exits that same iteration … even though there are many more lines in the file to be read.
I thought it was something to do with the IFS setting but it appears that a function call (when run... (3 Replies)
Hello,
I have researched and tried many way to pass OUT parameter to be stored in variable in KSH Script.Still not success, please help.
Here is my Store Procedure.
create procedure testout3(v_in varchar2,v_out OUT integer)
as
begin
v_out := 1;
end;
Here is my testvout.ksh
#!/bin/ksh... (1 Reply)
Discussion started by: palita2601
1 Replies
LEARN ABOUT PHP
array_product
ARRAY_PRODUCT(3) 1 ARRAY_PRODUCT(3)array_product - Calculate the product of values in an arraySYNOPSIS
number array_product (array $array)
DESCRIPTION array_product(3) returns the product of values in an array.
PARAMETERS
o $array
- The array.
RETURN VALUES
Returns the product as an integer or float.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.6 | |
| | |
| | The product of an empty array is now 1, when |
| | before this function would return 0 for an empty |
| | array. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
array_product(3) examples
<?php
$a = array(2, 4, 6, 8);
echo "product(a) = " . array_product($a) . "
";
echo "product(array()) = " . array_product(array()) . "
";
?>
The above example will output:
product(a) = 384
product(array()) = 1
PHP Documentation Group ARRAY_PRODUCT(3)