The following works for me, ie the TEST variable that i export is available within the script whereas not to the shell from which i invoked the script.
Note there isn't a " / " before bin. Could this be the problem ? Otherwise the method above is correct. Can you please paste the relevant part of the script ?
above is script named hi.sh #sh hi.sh
hi.sh: CLASSPATH=/opt/SBM:/opt:: is not an identifier
now tell me the reason of this error... I am frustated with this error not getting the reason.
one more thing is this when i write export CLASSPATH=/opt/SBM:/opt:$CLASSPATH on the shell prompt it is working fine
now tell me the solution
Yes, and it will also wotk in ksh or bash. If you write your code for sh it will work in ksh or bash.
The problem the original poster was seeing was becasue the shell they were using as a login shell supports the short syntax. But they were incorrectly running the script by specifing "sh scriptname", thereby ignoring the #!/bin/ksh in a script that is written as a korn script.
... NOTE: I am accepting parameters passed from Oracle Apps:
relevant code:
var1=$1
var2=$2
var3=$3
ReqID=$4
... NOTE: Displayed parameters are correct when this executes:
relevant code:
echo "$# unnamed params are $@"
... NOTE: I am creating and exporting a new variable using $4:
relevant code:
filename="o$ReqID.out"
export $filename
... NOTE: the error is produced and displays the path and file name of the UNIX script, the correct value for the var, then the error:
...o19130365.out: This is not an identifier.