02-04-2014
Thanks so much, it worked.
I though calling the CmnFuncs.ksh script should do the trick, didn't know that I need to call the function seperately.
---------- Post updated at 05:17 PM ---------- Previous update was at 05:16 PM ----------
The mis-match in the variable name was a typo
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i want to call a oracle function in my shell script (4 Replies)
Discussion started by: dineshr85
4 Replies
2. Shell Programming and Scripting
i have a function written in one shell script and i want to call that function in another shell script and use the value returned by that script.
can any one suggest me how can i do that?
regards,
Rajesh.P (4 Replies)
Discussion started by: rajesh.P
4 Replies
3. Shell Programming and Scripting
Here is the following code :
1.
# gcc -c test firstprog.c
the above command will generate a executable file called "test " in which ever directory it is run.
Assuming It will also return a value.
2. In the below SCRIPT . test is a file generated by compiling a c program... (3 Replies)
Discussion started by: Vabiosis
3 Replies
4. Shell Programming and Scripting
Hi,
I basically have 2 shell scripts.
One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system.
Another shell script is a script that does the job of connecting to the remote system using ssh. This uses a expect utility in turn.
... (2 Replies)
Discussion started by: sunrexstar
2 Replies
5. Red Hat
please help me in this script
shell script :1
***********
>cat file1.sh
#!/bin/bash
echo "this is first file"
function var()
{
a=10
b=11
}
function var_1()
{
c=12
d=13 (2 Replies)
Discussion started by: ponmuthu
2 Replies
6. Shell Programming and Scripting
hi everyone
i am trying to do this
bash> cat abc.sh
deepak()
{
echo Deepak
}
deepak
bash>./abc.sh
Deepak
so it is giving me write simply i created a func and it worked
now i modified it like this way
bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
7. Shell Programming and Scripting
I am getting Segmentation fault at below function call in my script:
get_x() {
sqlplus -s / <<end | grep KEEP | sed 's/KEEP//;s///g'
select 'KEEP' ,table_name from all_synonyms where upper(synonym_name)= '$1';
exit
end
x=$(get_x $1)
echo " SQL OUTPUT IS :: $x"
}
I am getting output of... (1 Reply)
Discussion started by: IB_88
1 Replies
8. Shell Programming and Scripting
Dear All,
I want to know how can i call oracle function from shell script code . My oracle function have around 5 input parameters and one return value.
for name in *.csv;
do
echo "connecting to DB and start processing '$name' file at "
echo "csv file name=$x"
sqlplus -s scoot/tiger <!... (2 Replies)
Discussion started by: Balraj
2 Replies
9. Programming
Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far:
#include<stdio.h>
#include<string.h>... (2 Replies)
Discussion started by: bjhjh
2 Replies
10. Shell Programming and Scripting
I am converting shell script to Perl. In shell I have a code
parse_prog_args()
{
if
then
while
do
case $1 in
-P* | -p* )
export PROCESS_DATE=$2
export MM=`echo $2 | cut -c5-6`
export DD=`echo $2 | cut -c7-8`
export YY=`echo $2 | cut -c3-4`
export... (4 Replies)
Discussion started by: digioleg54
4 Replies
exit(1) User Commands exit(1)
NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps
SYNOPSIS
sh
exit [n]
return [n]
csh
exit [ ( expr )]
goto label
ksh
*exit [n]
*return [n]
DESCRIPTION
sh
exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of
the last command executed (an EOF will also cause the shell to exit.)
return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe-
cuted.
csh
exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the
expression expr.
The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches
for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to
jump to a label that occurs between a while or for built-in command and its corresponding end.
ksh
exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8
bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing
a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit
except for a shell which has the ignoreeof option (See set below) turned on.
return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the
least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return
is invoked while not in a function or a '.' script, then it is the same as an exit.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 15 Apr 1994 exit(1)