For 1) try having the first line in the script like:
#!/usr/bin/ksh
or whatever your path to your Korn Shell is.
For 2)
To see which variables are exportet, use something like
env| grep <nameofyourvariable>
That you can see the value with echo is a good sign.
Afaik, with set, you only see what is in your current shell, not which has necessarily been exported.
You can test it by just using set A=1 and then use set. You will see it, but not when you use env.
After exporting you can start another shell from your current session and do "env| grep <yourvariablesname>" and will see that it has been definetly exported.
In addition: If you are just having variables in this script, it might be a way to just source this enviornment file, which would export all variables automatically. Sourcing means that you have a single dot in front of the script, when calling it. This could be done one the promt and also in some other script like .profile, which would be called at login automatically.
Example:
cat env_one
A=1
B=2
#then
. ./env_one
#start another shell to see if it's exported
ksh
env| grep -E "^A|^B"
No,I don't have variables in my script.I have more other operations in that.for my application I have to set the variable and after using that I am unsetting those variables.
I want it from my script,I am not able to understand why they are not being set by the script ??