Re: set environment variable



I was clarifing the scenario, i already resolved it building a file in
the 4gl and then source (.) it from bash as suggested.

Thanks

On 24 nov, 11:33, Ian Goddard <godda...@xxxxxxxxxxxxx> wrote:
eferreyra wrote:
the thing is we are a corporation where there is several enterprises,
and (at least) each one have one informix online instance, anyway
there are several informix instances...

With this scenario we have users that access several instances, but
this based on a permission scenario, not everybody access any informix
instance of course.

So we need to put some own logic in the .profile of the users sessions
to app servers (i4gl app servers), we design a model where there are
properties of the terminals (printer name, POS number, etc.) and
properties of the user (user-level, default enteprise, etc.) and
finally we have properties of the instance (informixserver, etc.) plus
could be some combinations user+instance could have different user-
level environment variable).

So we design a script that is called on the .profile of the user
session, it gets username, netbios name of the terminal, and the
instance the user could have several instances enabled so there is the
4GL program that picks up a instance. with those three elements we
build the environment variables for the session as a script, save this
to a file, then do a source (.) with the file. finally we get from
environment variables the directory to go and the program to execute
for the user.

Notice that the model is in informix tables and accessed by informix
4gl programs, prior the really get and build the user i4gl
environment.

Of course this is that way because we have a LOT of informix 4gl
programs that builds our ERP and more subsystems, the programs uses a
lot envirnment variables and cant do a cut-point redesign of the
systems, we are in a slow migration where i4gl coexists with .net
services.

Hope you understand :) we are a complex mesh of technology and
people...

As others have said you can't set an environment variable and have it
passed back to the calling program.  The Unix environment variable just
doesn't work like that.  It's one-way.

What you could do is build a command string in the 4GL program which
includes both setting the environment and executing the program for the
user.  You would then run this command string from within the 4GL.  This
would, of course, leave your existing 4GL program waiting for the user
program to execute.

--
Ian

Hotmail is for spammers.  Real mail address is igoddard
at nildram co uk

.



Relevant Pages

  • Re: set environment variable
    ... there are several informix instances... ... this based on a permission scenario, ... build the environment variables for the session as a script, ... This would, of course, leave your existing 4GL program waiting for the user program to execute. ...
    (comp.databases.informix)
  • Re: Multiple instances
    ... Add two functions to the .profile that export the relevant Informix ... environment variables and PS1. ... I use command prompt to see my current INFORMIXSERVER. ... When "onstat -" is run, is IDS returning the status for the DB server ...
    (comp.databases.informix)
  • Re: set environment variable
    ... there are several informix instances... ... this based on a permission scenario, ... to app servers (i4gl app servers), we design a model where there are ... build the environment variables for the session as a script, ...
    (comp.databases.informix)
  • Problem loading DBD::Informix
    ... I'm programming Perl DBI accessing Informix databases. ... this is as root with environment, amongst other environment variables, ...
    (comp.lang.perl)
  • Problem loading DBD::Informix
    ... I'm programming Perl DBI accessing Informix databases. ... this is as root with environment, amongst other environment variables, ...
    (comp.lang.perl.modules)

Loading