setting an environment variable (for libxml2)

U

Une bévue

because i plane to use XML Catalog, i have to set an environment
variable "XML_CATALOG_FILES" to the path the catalogs reside.

then if i do :

ENV['XML_CATALOG_FILES']="/path/to/catalogs"

does this env var be accessible by libxml2 and ruby-libxml ?

obviously, if i print back :
ENV.each { |k,v| p "#{k} => #{v}"}

i get it.

when i say accessible from libxml2/ruby-libxml it is only when those are
called from a ruby script...
 
R

Ross Bamford

because i plane to use XML Catalog, i have to set an environment
variable "XML_CATALOG_FILES" to the path the catalogs reside.
=20
then if i do :
=20
ENV['XML_CATALOG_FILES']=3D"/path/to/catalogs"
=20
does this env var be accessible by libxml2 and ruby-libxml ?

I'm not absolutely certain, but I don't think the change will be noticed
by libxml2/-ruby . Some quick experiments seem to bear this out, but
YMMV...

--=20
Ross Bamford - (e-mail address removed)
 
L

Logan Capaldo

because i plane to use XML Catalog, i have to set an environment
variable "XML_CATALOG_FILES" to the path the catalogs reside.

then if i do :

ENV['XML_CATALOG_FILES']=3D"/path/to/catalogs"

does this env var be accessible by libxml2 and ruby-libxml ?

obviously, if i print back :
ENV.each { |k,v| p "#{k} =3D> #{v}"}

i get it.

when i say accessible from libxml2/ruby-libxml it is only when =20
those are
called from a ruby script...
--=20
une b=E9vue

What you probably need to do is split your script in twain, 1 that =20
sets up the environment and one that does the work, eg:

logan:/Users/logan/Projects/Ruby Experiments% cat env1.rb
ENV["CUSTOM_ENV_VAR"] =3D "Hello"

exec("ruby env2.rb")
logan:/Users/logan/Projects/Ruby Experiments% cat env2.rb
puts "Custom ENV var is #{ENV["CUSTOM_ENV_VAR"]}"
logan:/Users/logan/Projects/Ruby Experiments% ruby env1.rb
Custom ENV var is Hello
 
U

Une bévue

Logan Capaldo said:
What you probably need to do is split your script in twain, 1 that
sets up the environment and one that does the work, eg:

logan:/Users/logan/Projects/Ruby Experiments% cat env1.rb
ENV["CUSTOM_ENV_VAR"] = "Hello"

exec("ruby env2.rb")
logan:/Users/logan/Projects/Ruby Experiments% cat env2.rb
puts "Custom ENV var is #{ENV["CUSTOM_ENV_VAR"]}"
logan:/Users/logan/Projects/Ruby Experiments% ruby env1.rb
Custom ENV var is Hello

ok, i see what u mean, i've done that with java to set, internaly, the
class path...

i need somehow an app launcher to setup the ENV correctly...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top