os_command.exec cannot cat file
SevConMar 18 2013 — edited Mar 19 2013Hi,
I am not sure which category this goes under so will move it if there is a better suggestion.
I am using the os_command pl/sql and java packages from soruceforge to issue unix commands from pl/sql.
I have it at the point where I can rm, touch files and issue commands such as ls but when I try and issue cat I get the message:
begin
select os_command.exec_clob('/bin/cat /home/oracle/rules/var.txt >/home/oracle/rules/var2.txt') into x from dual;
end;
I get:
/bin/cat: /home/oracle/rules/var.txt: No such file or directory
/bin/cat: >/home/oracle/rules/var2.txt: No such file or directory
Those files are owned by and in group oracle. I can run the command from the terminal and get the correct result.
If I put this command into a shell script and then execute that from pl/sql then I it succeeds.
Is there anything in particular that cat would need?
TIA
Sev