#!/bin/bash
. /home/oracle/env
if [ -z $1 ]
then
TABLE_NAME='emp'
echo $TABLE_NAME' count is :'
else
TABLE_NAME=$1
echo $TABLE_NAME' count is :'
set time on timing on pages 0 lines 200
select count(*) from scott.$TABLE_NAME;
exit
. /home/oracle/env
if [ -z $1 ]
then
TABLE_NAME='emp'
echo $TABLE_NAME' count is :'
else
TABLE_NAME=$1
echo $TABLE_NAME' count is :'
fi
sqlplus -S /nolog<<EOF
set time on timing on pages 0 lines 200
select count(*) from scott.$TABLE_NAME;
exit
EOF
知识点:-z判断字符串是否为空