error in in running script

Hi all,

I have created a script file .sh and had some allias commands, local variable, some grep features, and listing files/directories, and it worked correctly and I got the outputs I am looking for after I run the script . However, some of the grep commands and some other functions did not worked after I tried to run the script in another script to get the output of the original script printed in another scrip so I can print out the output. Does anyone know what is the problem with that ?

e.g. my is script kk.sh and it runs and prints the output after I run it the permission is 700
.
.
Then I did:
script output.out <enter>
kk.sh
exit
.
.
some of the outputs didn't worked in output.out.. why? and how I can fix it ?

However,
script1.sh
does some stuff
exits and you can see desired results

script2.sh
does some stuff
calls script1.sh
(script1 is now a child process)
gets unexpected results

script2 can export variables for use by the child script1; but the reverse is not true. Variables set in the called script1 are not known by script2.

for instance, with the following code

script2.sh
   x=12
   export $x
   script1
   echo $x $y
exit
script1.sh
   y=13
   export $y
   echo $x $y
exit

running script2.sh will show
12 13
12

The top line is from script1.sh since it knows both variables
The second line is from script2.sh and it only knows x

Does your kk.ksh have a shebang line at the beginning, e.g. #!/usr/bin/ksh? The reason I ask is because when you run script, by default it launches a standard sh shell, so unless you have a shebang line in your script it may be running under sh insted of the usual ksh, and could explain why some of your code no longer works.