Paul,
Thanks for the advice. Now i added the scripts in a separate file. when i execute the script as standalone, it is FTPing the file as expected. But I am facing problems while executing it through the ProcessBuilder API. shell script is placed in the web-inf/config/dev folder
TestScript.sh
cd /temp/
ftp -n ftwssfg.aur.com
quote user amwkui
quote pass amwkui
cd /home/data/
put todayFile.txt
quit
exit
Below is error i am getting when i run the above piece,
/usr/bin/bash: No such file or directory
Also when i changed the parameters to processbuilder class as below,
ProcessBuilder pb = new ProcessBuilder("sh", "web-inf/config/dev/TestScript.sh" );
I got the error below error,
web-inf/config/dev/TestScript.sh: Cannot open
I am not sure about the working directory. Is it the directory where the script is placed?
Please suggest on this.