Calling OS-Commands from Oracle

If you're thinking of calling commands on the operating system from Oracle PL/Sql you might want to take a look at this code or this explanation. There are also some security aspects which you should not overlook when using this kind of functionality.

CREATE OR REPLACE FUNCTION shell(cmd IN VARCHAR2)
RETURN PLS_INTEGER
AS
LANGUAGE C
LIBRARY extprocshell_lib
NAME "extprocsh"
PARAMETERS (cmd STRING, RETURN INT);
/