1

I have a shell script (bash) that executes a sqlplus command, and it works perfectly when I run it from a terminal (or SSH clients like PuTTY or Xshell), what means I can read its output. Now I created a web interface where the user can start this script, but the execution fails because this same sqlplus seems not to be executed. Have a look at the following simplified examples I created:

Test shell script (test.sh):

echo 1
sqlplus -s SIEBEL/SIEBEL@SBLQA02 @select.sql
echo 2

select.sql:

select 'a' from dual;
exit;

Output generated in a terminal:

1

'
-
a

2

Output generated on a web client (so far I tried to use Ganymed SSH-2 for Java and sshj, producing the same result):

1
2


As you can see, only the simple echo commands have generated output. What happened to the sqlplus output? Am missing anything?

Thanks in advance for any help!

1 Answers1

1

In case it helps someone: sqlplus was not in the path in the session created in the application server by the SSH API, so the sqlplus command was not being found, and obviously no standard output has been generated. The problem could be solved exporting the sqlplus path prior to its calling in the shell script.