- 论坛徽章:
- 0
|
求教:spool 到一个文件,但是又在屏幕上有输出,why?
sep='|'
echo " set colsep $sep;
set echo off;
set feedback off;
set heading off;
set pagesize 0;
set linesize 1000;
set numwidth 12;
set termout off;
set trimout on;
set trimspool on;
spool hp.txt;
--------------sql 语句
spool off;
------------连接db
if [[ -f hp.txt ]]
then
cat hp.txt | grep -v "^SQL>;" >;hpp.txt
sed -e "s/ *$//g" hpp.txt >;hp.txt
cat hp.txt|grep -v "pay" >;hpp.txt
if [[ `grep "ORA-" hpp.txt` = "" ]]; then
echo "unload table dba_user....\t\t\t\t\t\t ok"
else
cat hpp.txt
err="$err hpp"
fi
else
echo $0 error
fi
if [[ "X$err" = "X" ]];then
echo unload complete!
else
echo "unload table $err error, please check it!"
fi
奇怪的是,导一个70M的文件可以,而导200M的就既向屏幕输出又向文件输出,怪! |
|