exporting parameters for child scripts

i have a script which am calling it with 2 keyword parameters like below
a.ksh -a 1 -b 2
this script internally called two other scripts called a1.ksh and a2.ksh.
which means
a.ksh is the wrapper
and a1.ksh and a2.ksh are the child scripts called inside them.
my question is,
will the script a1.ksh and a1.ksh be able to inherit the 2 keyword parameter
that i pass to a.ksh, or do i need to explicitly export these 2 keywords
parameters inorder for them to be used by the child scripts.
please clarify
--
Thanks
Ashu

In your script assign them new variable names. Then export the new variables and you will have access to them with the children processes. I you do not reassign them, $1, and $2 will be reset when the children scripts start with their command line arguments.
<code>
export var1=$1
export var2=$2
</code>
or
<code>
var1=$1; export var1
var2=$2; export var2
</code>
You must use the export verb to make sure that any child process from the original script get the variables that they need.
When a script calls another script like this, it creates a new process and all of the exported variables are duplicated under the new process's environment. Any variables that have not been exported, are not copied to the new process.

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.