Question : Problem run the ksh script after run BASH.

Hi,

I am trying to identify the problem that I am experiencing.
I have a bouch of the shell script and perl scripts that work together as a set of process. This script run continuesly, Once kicking off the shell script, only way to stop it is kill the processes.
The code run correctly before in the test environment.
Before I run it again today, I have run the BASH ( the shell scripts are writen in KSH). Most likely, it is where the problem coming from.
I believe that IF condition in the KSH doesn't works for BASH. It will always go to the first statement of the IF clause. for example, in the following script, command 1 will be executed even through the $id equal to null value. am I right on this.

 if ($id ne "")
command 1;
else
command2;

Once thing I don't understand is that, once I kill the processes, run the KSH and rerun the scripts, problem still there. I try to logout from UNIX and login again, still same problem. I am using SSH to login to UNIX box. Wondering if my guess regarding the potential problem is correct or am I in the right track.

Thanks for any tips

Answer : Problem run the ksh script after run BASH.

The if is indeed not for bash. It should read
if [ "$id" != "" ]; then # or if [ -n "$id" ]
 c1;
else
 c2;
fi

But script have control of shell it's running under. It's in the very first line of script. It should read
#!/bin/ksh
Random Solutions  
 
programming4us programming4us