Hi,
Try this..if u want to remove sqlplus option remove it this will give u data only
or u can use EXIT; in ur script that will bring control back to ur script from sqlplus
show()
{
x=`sqlplus -s scott/tiger<<!
set echo off
set serveroutput on
set heading off
set feedback off
select * from details;
EXIT;
!`
echo $x>>log
} #echo "before "
show
I can't recreate that result. What shell are you using?
show() { echo "Hi" ; }
will define a function but does not run it. No output occurs.
show() { echo "Hi" ; } | tee -a log
The pipeline forces creation of a subshell. The subshell defines a function then exits producing no output. The empty output is piped to tee. With the -a option, tee appends nothing to the file. Maybe the file had Hi from a previous run?. The pipeline exits. Now when the parent shell next encounters "show", it will have no idea what that is supposed to be.
show() { echo "Hi" ; }
show | tee -a log
is maybe what you are trying to do.