You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by Gunnar Tapper <ta...@gmail.com> on 2016/08/13 06:52:10 UTC

trafci connection info in a file

Hi,

I'm running trafci from a Linux box outside a Trafodion cluster. I'd really
like to be able to type: trafci -q "get schemas;" or something like that
rather than having to put in all the connection info.

The Command Interface Guide shows how to set an alias but that doesn't
allow optional parameters. So, I went with a function: function trafci() {
./trafci -h host.com:23400 -u usr -p pwd $@; }, which works as long as the
argument string isn't quoted; the shell strips off the quotes.

Is there a .trafci or something that I can populate with the connection
info?

-- 
Thanks,

Gunnar
*If you think you can you can, if you think you can't you're right.*

Re: trafci connection info in a file

Posted by Gunnar Tapper <ta...@gmail.com>.
Hi Arvind,

Alas, this doesn't work since the command argument itself gets quoted in
addition to the argument value.

Gunnar

On Sat, Aug 13, 2016 at 2:53 AM, Arvind <na...@gmail.com> wrote:

> Hi Gunnar,
>
>
>
> Defining a function/alias seems to be a good way to do it, unless you want
> trafci to prompt you for the hostname:port/username/password.
>
>
>
> Could you try by including double quotes in your function definition ?
> That should help execute commands via -q or -sql or -s as described in :
>
>
>
> http://trafodion.incubator.apache.org/docs/command_
> interface/index.html#trafci_option_params
>
>
>
> function arvci() { trafci.sh -h host.com:23400 -u usr -p pwd “$@”; }
>
>
>
> Alias should also work in the same way (enclose in single quotes)
>
>
>
>                alias  arvci=’trafci.sh -h host.com:23400 -u usr -p
> pwd “$@” ‘
>
>
>
> Do excuse if I misunderstood the problem with function/alias definition.
>
>
>
> I’m not currently aware of how to pass the connection information for
> trafci– jdbc applications can pass the information to the driver via
> properties file. I’ll look up or someone on this list will chime in, if it
> is possible, with that information.
>
>
>
> Regard
>
> Arvind
>
>
>
> *From:* Gunnar Tapper [mailto:tapper.gunnar@gmail.com]
> *Sent:* Friday, August 12, 2016 11:52 PM
> *To:* user@trafodion.incubator.apache.org
> *Subject:* trafci connection info in a file
>
>
>
> Hi,
>
>
>
> I'm running trafci from a Linux box outside a Trafodion cluster. I'd
> really like to be able to type: trafci -q "get schemas;" or something like
> that rather than having to put in all the connection info.
>
>
>
> The Command Interface Guide shows how to set an alias but that doesn't
> allow optional parameters. So, I went with a function: function trafci() {
> ./trafci -h host.com:23400 -u usr -p pwd $@; }, which works as long as
> the argument string isn't quoted; the shell strips off the quotes.
>
>
>
> Is there a .trafci or something that I can populate with the connection
> info?
>
>
>
> --
>
> Thanks,
>
>
>
> Gunnar
>
> *If you think you can you can, if you think you can't you're right.*
>



-- 
Thanks,

Gunnar
*If you think you can you can, if you think you can't you're right.*

RE: trafci connection info in a file

Posted by Arvind <na...@gmail.com>.
Hi Gunnar,

 

Defining a function/alias seems to be a good way to do it, unless you want trafci to prompt you for the hostname:port/username/password.

 

Could you try by including double quotes in your function definition ? That should help execute commands via -q or -sql or -s as described in :

 

http://trafodion.incubator.apache.org/docs/command_interface/index.html#trafci_option_params

 

function arvci() { trafci.sh -h host.com:23400 <http://host.com:23400>  -u usr -p pwd “$@”; }

 

Alias should also work in the same way (enclose in single quotes)

 

               alias  arvci=’trafci.sh -h host.com:23400 <http://host.com:23400>  -u usr -p pwd “$@” ‘

 

Do excuse if I misunderstood the problem with function/alias definition.

 

I’m not currently aware of how to pass the connection information for trafci– jdbc applications can pass the information to the driver via properties file. I’ll look up or someone on this list will chime in, if it is possible, with that information.

 

Regard

Arvind

 

From: Gunnar Tapper [mailto:tapper.gunnar@gmail.com] 
Sent: Friday, August 12, 2016 11:52 PM
To: user@trafodion.incubator.apache.org
Subject: trafci connection info in a file

 

Hi,

 

I'm running trafci from a Linux box outside a Trafodion cluster. I'd really like to be able to type: trafci -q "get schemas;" or something like that rather than having to put in all the connection info.

 

The Command Interface Guide shows how to set an alias but that doesn't allow optional parameters. So, I went with a function: function trafci() { ./trafci -h host.com:23400 <http://host.com:23400>  -u usr -p pwd $@; }, which works as long as the argument string isn't quoted; the shell strips off the quotes.

 

Is there a .trafci or something that I can populate with the connection info?  


 

-- 

Thanks,

 

Gunnar

If you think you can you can, if you think you can't you're right.