Re: Display shell script output

  • From: "Radoulov, Dimitre" <cichomitiko@xxxxxxxxx>
  • To: <ranko.mosic@xxxxxxxxx>
  • Date: Sat, 15 Jul 2006 16:55:21 +0200

> I need to be able to see commands executed on the sceen - they are not
> echoed now:

Shell or sqlplus commands?

For shell use 

#!/bin/ksh -v (to print shell input lines as they are read or -x if you need to 
print the commands and their arguments, or -xv for both)

For sqlplus:

From SQL*Plus User's Guide and Reference:

SET ECHO {ON | OFF}
Controls whether or not to echo commands in a script that is executed with @, 
@@ or START. ON displays the commands on screen. OFF suppresses the display. 
ECHO does not affect the display of commands you enter interactively or 
redirect to SQL*Plus from the operating system.

So you could:

1. Write a sql sqlript and then run it in the shell script as @script.
2. Prompt the commands:

#!/bin/ksh
sqlplus system/password<< EOF
set echo on
set termout on
set feedback on
prompt Create user test1 identified by  test
prompt default tablespace rcvcat_tbs
prompt duota 0 on system;
Create user test1 identified by  test
default tablespace users
quota 0 on system;
exit;
EOF


Dimitre

Other related posts: