10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm having a little trouble returning a value from a function or calling it, I'm not quite sure.
I'm calling the function here
function region_lookup_with_details {
results = $(set_region)
echo $results
}
This is the function I'm calling
function set_region {
... (8 Replies)
Discussion started by: akechnie
8 Replies
2. Shell Programming and Scripting
Hi,
I need to return a value from the function. the value will be the output from cat command which uses random fucntion.
#!/bin/ksh
hello()
{
var1=$(`cat /dev/urandom| tr -dc 'a-zA-Z0-9-!%&()*+,-/:;<=>?_'|fold -w 10 | head -n 1`)
echo "value is" var1
return var1
}
hello
var=$?... (2 Replies)
Discussion started by: Nandy
2 Replies
3. Shell Programming and Scripting
I am trying to generate some scripts to help manage an Oracle database. When I check the value returned from Oracle it has a leading carriage return in the variable. Is there a way to prevent this? Is there a way to easily strip out the carriage return. See code and output below.
... (7 Replies)
Discussion started by: Panzer993
7 Replies
4. Shell Programming and Scripting
can anyone please help me with this:
i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure...
... (4 Replies)
Discussion started by: swap21783
4 Replies
5. UNIX for Dummies Questions & Answers
I get an error when I grep my results into a variable when the grep finds more than one file.
FND="$(find ediout* -mmin -60)"
if ; then
STR="$(find ediout* -mmin -60 -exec grep -l "ERRORS Encountered" {} +)"
fi
When there is only one ediout file it works fine. How do I... (11 Replies)
Discussion started by: aispg8
11 Replies
6. UNIX for Dummies Questions & Answers
Sometimes I observe this in gdb:
(gdb) br my_function
Breakpoint .. at 0x...: file ..., line ...
i.e., "my_function" does exist in the current executable.
however, dlsym does not find it:
(gdb) p dlsym(0,"my_function")
$6 = 0
This is a C program; dlsym does find other defined functions and... (2 Replies)
Discussion started by: sds
2 Replies
7. Shell Programming and Scripting
Hi
I have a small function which returns a wrong value.
The function tries to make a connection to oracle database and tries to get the open_mode of the database in the variable status.
However when a database is down the value of the status column is set to READWRITE i am not sure why.
I... (0 Replies)
Discussion started by: xiamin
0 Replies
8. Shell Programming and Scripting
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies
9. Shell Programming and Scripting
Hi All
I have written code for storing data in a string based on pattern.
whenever i tried to use in a function call its not getting there.
Actually the same logic was applied for another string..then i can use the
string at any function.
the code goes like this
/mp metadata/{... (1 Reply)
Discussion started by: madhaviece
1 Replies
10. Shell Programming and Scripting
Can I create a function to return non-interger value in shell script?
for example,
function getcommand ()
{
echo "read command"
read command
echo $command
}
command=$(getcommand)
I tried to do something as above. The statement echo "read command" does not show up.
... (5 Replies)
Discussion started by: lalelle
5 Replies