UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3176 - October 17, 2009
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SHELL SCRIPTING A SQLPLUS SCRIPT
Here is a tip on how to run sqlplus scripts within a shell script. It is an example of how to pass database values into shell variables and to make shell scripts more dynamic. This maybe elementary to some folks but hope it helps others.....Here is the syntax:
#!/bin/sh
dummyvar=`sqlplus -s username/password <<end
set pagesize 0 feedback off ver off heading off echo off
select sysdate from dual;
exit;
end`
echo "system date is " $dummyvar
Tidak ada komentar:
Posting Komentar