To debug a possible permission related issue while invoking an FTP, testing a shell script by invoking it from an oracle JAVA procedure. The script contain some standard commands like whoami(to find out the session user), ls,.. The script works fine when invoked directly from the server. However when invoked from the DB JAVA procedure, all it recognizes is 'echo' command. Any thoughts in this regard will be of great help. Thank you!
shell script(FileTransfer.sh):
``#!/bin/ksh`
`echo "from double" >> /usr/users/ais/data/utl_data/Logs1.txt`
whoami >> /usr/users/ais/data/utl_data/Logs1.txt
ls >> /usr/users/ais/data/utl_data/Logs1.txt
echo "from double line 11" >> /usr/users/ais/data/utl_data/Logs1.txt
echo "from double line 13" >> /usr/users/ais/data/utl_data/Logs1.txt
JAVA Procedure
public class FTPTest{
public static int testSH () throws Exception {
String[] command = { "sh" "/usr/users/ais/data/utl_data/FileTransfer.sh"};
Process p = Runtime.getRuntime().exec(command);
try {
p.waitFor ();
}
catch (InterruptedException ie) {
;}
return p.exitValue ();
}
echo $PATHto the script ...