RE: fglgo seems to pick up the wrong environment
Posted in 1998
A word of caution about 'which' - according to the man page on HP-UX, which(1) determines
the PATH by sourcing the users .cshrc file, which is only used by C shell users. If the
user is a Bourne/Korn shell user, their PATH is set in .profile. Thus, 'which' may not
be using the same PATH that you might think and you may be executing a different version
of the program than 'which' reports. Check the .cshrc file of the user that is running
i4gl and you may find the mystery directory included in that PATH statement.
Mark Collins
mcollins@us.dhl.com
The problem lies in how easily and dangerously we forget that
manipulating things is not the same as understanding them.
> I can't diagnose those exact symptoms but a good first step with all
> shell scripts is to ensure the first line is:
> #!/bin/ksh
>
> or whatever shell you are using. Informix has a habit of running stuff
> using the born shell which can lead to all sorts of spurious results.
>
> Jon
>
> > ----------
> > From: Robert Stuart[SMTP:robert_stuart@nfer-nelson.co.uk]
> > Reply To: Robert Stuart
> > Sent: 08 July 1998 10:31
> > To: informix-list@iiug.org
> > Subject: fglgo seems to pick up the wrong environment
> >
> > I'm trying to test a new component in my system, calling it through a
> > shell script from within a 4gi program.
> > Unfortunately, whenever I run the test, I call the old (live) script.
> >
> > Running the script from UNIX gives the test result I want, running it
> > from within a i4gl, I call the live script - in other words, I'm not
> > testing the component.
> >
> > Details of my checks are listed below
> >
> >
> >
> > TIA
> >
> > Robert Stuart
> >
> >
> >
> >
> > If I type
> > $ which some_script> >
> > I get
> > /my_test_path_to/some_sript
> >
> > Where /my_test_path_to is set in my PATH environment variable
> >
> >
> > If I write and run the following through fglgo
> >
> > MAIN
> > RUN "which some_script"
> > END MAIN
> >
> > I get
> > /the_live_path_to/some_script
> >
> >
> > Where /the_live_path_to does NOT exist in my UNIX shell environment
> > ...
> > nore does it show up when checked through fgl_getenv( "PATH" ).
> >
> >
> > $ which fglgo gives me the standard location of my informix> > binaries, fglgo is a binary
> >
> > $ fglgo -v
> > INFORMIX-4GL Version 4.11.UC2
> > Pcode Version 8> > Software Serial Number [some serial no]
> >
> >
> >
---------------End of Original Message-----------------