Hi
Perl/UNIX experts,
I have a problem in running a shell script from my
perl script (auto.pl).
I run the
perl script using
perl auto.pl
from the shell prompt
The shell script picks the files in "input" folder and procesess it.
The shell script blue.sh has this code.
Code:
export JAVA_HOME=/opt/j2sdk1.4.2_02
export PATH=${JAVA_HOME}/bin:${PATH}
export MANPATH=${JAVA_HOME}/man:${MANPATH}
export RUNPATH=:.:/export/home/lib/activation.jar:/export/home/lib/commons-dbcp-1.1.jar:/export/home/lib/jdbc2_0-stdext.jar:/export/home/lib/libmqjbnd05.so:/export/home/lib/postcard.jar
export RUNPATH=$RUNPATH:/export/home/lib/ant.jar:/export/home/lib/commons-logging-api.jar:/export/home/lib/jms.jar:/export/home/lib/log4j-1.2.8.jar:/export/home/lib/providerutil.jar
export
java -classpath $RUNPATH placeOrders ./input/
I tried to run this in
perl script using
exec("blue.sh")
exec("./blue.sh")
`./blue.sh`
`sh blue.sh`
I get this error -
./blue: JAVA_HOME=/opt/j2sdk1.4.2_02: is not an identifier
But if i run it manually from the shell
the script runs fine.
I guess the problem is because
perl spawns a new shell.