Hi Eric
Have a look at :
http://www.unixshell.us/shell-scripting/ksh-quoting-block-t1034.html - which
seems to describe an issue identical to yours.
The user there:
a) Was using the same 1993-12-28 ksh93 as you are on Solaris
b) Was executing sqlplus in a $()
c) Had issues with quoting of the command passed to sqlplus
d) Found the issue resolved when he used backticks instead.
You're also calling sqlplus, and your issue also seems related to quoting -
your "invalid identifier" error from sqlplus is I think because sqlplus
isn't getting the right quotes passed to it.
Now, the version of ksh93 you are running on Solaris is far older than the
one you have on Linux:
> Linux dorado 2.6.18-92.1.13.el5 #1 SMP Wed Sep 24 19:33:52 EDT 2008 i686
> i686 i386 GNU/Linux
> >print ${.sh.version}
> Version M 93s+ 2008-01-31
> SunOS blenny 5.9 Generic_122300-07 sun4u sparc SUNW,Sun-Fire-V210 Solaris
> >print ${.sh.version}
> Version M 1993-12-28 s+
So I think this is simply a bug in the old version of ksh93 you are running
on Solaris, and I would upgrade ksh93 on your Solaris machine. The ksh93
binary for Solaris is easily downloadable from the ksh93 page at
http://www2.research.att.com/sw/download/. You can download just the ksh93
binary if you want, or a package containing the man pages and libraries and
so on. If you download just the binary then you won't need to install it -
just put the binary in place - and therefore this works fine even if you
don't have root on that machine.
By the way, I noticed that you're stripping out the sqlplus headers using
grep. There's a nicer way - run sqlplus with the -s command line argument
and it won't print any of those headers, as shown here:
t...@db2-access1:~$ sqlplus -s tomj/bul...@qa1 <<< "select count(*) from
user_tables;"
COUNT(*)
----------
307
t...@db2-access1:~$
You can also set various sqlplus options to control its output to make it
script-friendly - for example "set pagesize 0" will turn off column
headings, page headings, page divisions, and more, making output much more
suitable for script processing.
t...@db2-access1:~$ sqlplus -s tomj/bul...@qa1 <<< "set pagesize 0
> select count(*) from user_tables;"
307
t...@db2-access1:~$
I use this page as my reference point for sqlplus options - there's quite a
few others that you may find useful in scripts:
http://ss64.com/ora/syntax-sqlplus-set.html
Hope that helps,
Tom
---------------------------------------------------
Tom Jobbins – VP, Systems Engineering
Flytxt | http://www.flytxt.com
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users