Refer the oracle documentaion for plsql i/o(sample file deamon.sql). You can use a combination of a ProC program and dbms pipes to pass shell commands from within a plsql stored procedure.