I have two string returning function in ESQL/C
char *segment_name(lbuffer)
char *lbuffer;
{.....
and
char *get_bpdvalue(f_name)
char *f_name;
{......
both declared above main()
char *get_bpdvalue();
char *segment_name();
my problem is segment_name works on sprintf and strcpy... (5 Replies)
Hi all,
I am very new to BASH shell programming. I need to return an integer from a function to the caller function. I did this:
but it keeps giving me wrong return:
Can someone help me out here, please?
Thanks (2 Replies)
Hi All
In my script, I can call on several functions. I have a logging function that is called by any of these functions. What I would like is some way of identifying which function I am using and pass this to the log function as some parameter.
Is there some built in command or way of... (3 Replies)
i have an oracle function which returns two values, one is the error message if the function encounters anything and another one which returns a number
i need to capture both
and pass it on to unix shell script
how to do it (2 Replies)
I know multiple values can be returned from a function in C like this:
char **read_file ( char * , unsigned long int * );//this is the function prototypeunsigned long int number_of_words = 0;//variable defined in main() and initialized to 0words_from_dictionary = read_file ( "dictionary.dit" ,... (2 Replies)
I've been trying to write a command-line function to grab a website's MX records and their ip addresses. The code below works with domains that only have one MX record:
function kmx { mx=`host -t MX $1 | awk '{ print $7 }'`;
ip=`host $mx | sed '/IPv6/d;/handled/d' | awk '{ print $4 }'`; ... (8 Replies)
Hi
I am pretty confused in returning and capturing multiple values
i have defined a function which should return values "total, difference"
i have used as
#!/usr/bin/ksh
calc()
{
total=$1+$2
echo "$total"
diff=$2-$1
echo "$diff"
}
I have invoked this function as
calc 5 8
Now i... (2 Replies)
Hi
I have a code as the following
#!/usr/bin/ksh
set -x
row()
{
a=$1
b=$2
c=$(($a + $b))
d=$(($a * $b))
echo $a $b
}
e=`row 2 3`
set $e
echo "The value of c is $c"
echo "The value of d is $d"
My requirement is I need to pass two arguments to a function and return two values... (5 Replies)
Hi,
I have a small part of a project which is done as a bash script. bash was selected as an portability issue that works out of the box. In this script I have an exec shell-function, a wrapper around arbitrary commands. I want to have STDOUT, as an addon STDERR and the EXIT-CODE of a specified... (5 Replies)
Discussion started by: stomp
5 Replies
LEARN ABOUT PHP
echo
ECHO(3) 1 ECHO(3)echo - Output one or more stringsSYNOPSIS
void echo (string $arg1, [string $...])
DESCRIPTION
Outputs all parameters.
echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other
language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want
to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.
echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. Prior to PHP 5.4.0, this short syn-
tax only works with the short_open_tag configuration setting enabled.
I have <?=$foo?> foo.
PARAMETERS
o $arg1
- The parameter to output.
o $...
-
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
echo examples
<?php
echo "Hello World";
echo "This spans
multiple lines. The newlines will be
output as well";
echo "This spans
multiple lines. The newlines will be
output as well.";
echo "Escaping characters is done "Like this".";
// You can use variables inside of an echo statement
$foo = "foobar";
$bar = "barbaz";
echo "foo is $foo"; // foo is foobar
// You can also use arrays
$baz = array("value" => "foo");
echo "this is {$baz['value']} !"; // this is foo !
// Using single quotes will print the variable name, not the value
echo 'foo is $foo'; // foo is $foo
// If you are not using any other characters, you can just echo variables
echo $foo; // foobar
echo $foo,$bar; // foobarbarbaz
// Some people prefer passing multiple parameters to echo over concatenation.
echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10);
echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "
";
echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon. no extra whitespace!
END;
// Because echo does not behave like a function, the following code is invalid.
($some_var) ? echo 'true' : echo 'false';
// However, the following examples will work:
($some_var) ? print 'true' : print 'false'; // print is also a construct, but
// it behaves like a function, so
// it may be used in this context.
echo $some_var ? 'true': 'false'; // changing the statement around
?>
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
SEE ALSO print(3), printf(3), flush(3), Heredoc syntax.
PHP Documentation Group ECHO(3)