#!/usr/bin/ksh
RETVAL=`sqlplus -s /nolog <<EOF
connect scott/tiger@dev
--create or replace procedure do_stuff(p_fname out varchar2, p_cnt out number)
--is
--begin
-- p_fname := 'abc.txt';
-- p_cnt := '5';
--end;
--/
set serveroutput on
declare
v_fname varchar2(10);
v_cnt number;
begin
do_stuff(v_fname, v_cnt);
dbms_output.put_line(v_fname);
dbms_output.put_line(to_char(v_cnt));
end;
/
EOF`
#echo $RETVAL
FNAME=`echo $RETVAL | awk '{print $2}'`
CNT=`echo $RETVAL | awk '{print $3}'`
echo File $FNAME
echo Count $CNT
dev>>t.ksh
File abc.txt
Count 5
you can also just redirect the output to a temp file, then grep for whatever you want. e.g. dbms_output.put_line('KEEP_FileName '||v_fname);
Then just grep for KEEP_FileName in the temp file...