shell script calling problem

Hi all,

I am calling one shell script from other ...as follow

---calling_proc---code
line_no=10
proc_name='test'
echo "set verify off feedback off pagesize 0
select count(*) from tp_mpolicy2 " | sqlplus -s/@CMKT | read cnt
if [ $? -ne 0 ]; then
export $line_no $proc_name
global_proc $line_no $proc_name
else
echo Success
fi

----global_proc ---code
echo $line_no $proc_name
-----------------------------------

But when I run calling_proc it gives me error as follows
calling_proc[9]: 10: is not an identifier

If any ideas Please help asap

Thanks

The problem is that you are misusing the "export" command. This command puts one or more variables into the environment table using the syntax:

export variable1 variable2 ...

In your script, the variable line_no in the line "export $line_no $proc_name" has a value of 10. As the shell expects a list of variables to export and variables have to start with a letter or underscore (_) you get an error. The next line calls the second script with parameters, so just remove the "export ..." line and all should be fine.

cheers

Thanks for the help..

But the error in the script was:-
I should have used $1 $2 ...but instead was using $line_no etc.

also as per u export command was not needed at all while passing arguments to the called script..

Thanks....