Re: osql script

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Thu, 8 Mar 2012 11:05:03 -0500
David Venus <[email protected]> wrote:

> After doing some testing with the osql script yesterday I found the
> following:
> 
> 
>    - For AIX (at least at 6.1 and 7.1) the host command needs to have
> a "-n" switch to get the "new"
>    format that the osql expects.

Dave, thanks for reporting this.  I think of osql as an experiment in
Bourne shell script portability, something no sane person should ever
attempt.  Based on reports here, it's easier than it once was.  The
domination of Linux & BSD is evinced by the fact that yours is the
first AIX issue.  Solaris can't be too popular either, because osql
won't run there.  At least on the Solaris I've been using
lately, /bin/sh doesn't support the $() form of ``.  

If you would please post your modified osql to this list (or send
it to me offlist) I'll happily merge in your changes.  Please tell me
the output of uname(1) without options.  I will add code something like:

if [ AIX = $(uname) ]
then
	HOSTOPTS=-n
fi
HOSTCMD="host {$HOSTOPTS}"

and replace all references to host with ${HOSTCMD}.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.