Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> c-shell: use of << EOF and piping
Howdy,
background: my workplace has a very large unix system with multiple databases and applications centred on mining production and exploration data. part of what i do is to run a series of batch data extract and format jobs, which are written in pl/sql but driven by c-shell scripts on solaris 2.5 (i think).
the problem: part of the multiuser environment is *hiding passwords*. this has been achieved in the past by storing the password of the rdbms in a file with very tight unix permissions that are called as per the example below. however, if sneaky users do a ps -aef | grep <username> they can see the the password displayed.
sqlplus `cat password_file` @select_script.sql $1 $VARIABLE | awk '/ORA-/||/PLS-/||/PL\/SQL:/' > select.log
(the above should all be on one line) as you can see from the above example, i:
this works very well, but i come up with the password snooping problem outlined above.
the obvious solution is to use "<< EOF" as follows:
sqlplus << EOF
username/password
@select_script.sql $1 $VARIABLE
EOF
which works. however, i *must* be able to pipe the output to
awk '/ORA-/||/PLS-/||/PL\/SQL:/' > select.log
and the obvious solution of
sqlplus << EOF
username/password
@select_script.sql $1 $VARIABLE
EOF | awk '/ORA-/||/PLS-/||/PL\/SQL:/' > select.log
does not work. i suppose i could write it to a temp file or something and then cat that for awk, but that's not the point is it?
if anyone has any suggestions....
cheers
ben Received on Sat Apr 25 1998 - 00:00:00 CDT
![]() |
![]() |