LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-29-2003, 06:50 AM   #1
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Rep: Reputation: 15
two homes??


I have a product, lets call it GGM, This product has two versions
GGM1 and GGM2. If I only run one of them it is all fine but how do I set up GGM_HOME to two different paths? I am not able to change the variable GGM_HOME? Anyone that knows?
 
Old 01-29-2003, 07:10 AM   #2
0x0001
Member
 
Registered: Sep 2002
Distribution: Slackware 8.1
Posts: 84

Rep: Reputation: 15
Assuming you are using bash:
export GGM_HOME=/whatever/you/like
 
Old 01-29-2003, 07:12 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's an extremely bizaarely phrased question, what's wrong with actually stating what you're doing? maybe you work for the FBI? we can only help you if you give some useful information
 
Old 01-29-2003, 07:16 AM   #4
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
0x0001:
Yes I use export GGM_HOMEath/path/GGM1
which works for the first one, but what to do with the other, with GGM2. It uses GGM_HOME too?

acid_kewpie:
Does it really matter what the product is called, you would not know what it was anyway, also it is a product my company is developing so I am not allowed to tell...
 
Old 01-29-2003, 07:25 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
because so many people incorrectly decide what the problem and so want to know how to fix what they think the problem is, without letting us know the circumstances to make sure they DO know what the problem is...

so with your secret program you will presumably need to run each instance inside it's own shell environment, maybe this will be easiest by having a shell script for each instance, assuming you can name them in a hard coded sense. so just have
Code:
#!/bin/sh
GGM_HOME=/blah/arse
ggm_whatever_that_is
in say... a "ggm1" script file, and just copy it and change the needed for the other one. should be fine. might want to export the variable as you set it aswell. not sure.
 
Old 01-29-2003, 08:30 AM   #6
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
acid_kewpie

Well my problem is I do not know how to make two GGM_HOMES to two different paths. Since I too develop this product I am pretty sure what to do to “fix” it. But my question is:

how can I make to exports with the same variable (GGM_HOME) to two different paths?

Why do I have to make a shellscript? Does it help me to run two instances and two versions of this product? With only one instance I do not need a shellscript. But this export is included in a file called /etc/profile.local. How do I put both of them there?
 
Old 01-29-2003, 09:28 AM   #7
0x0001
Member
 
Registered: Sep 2002
Distribution: Slackware 8.1
Posts: 84

Rep: Reputation: 15
Quote:
Originally posted by KaktusKnight
how can I make to exports with the same variable (GGM_HOME) to two different paths?
Not.

However it is quite frequent in linux if there are multiple possible paths to delimit them with a : (colon).

export GGM_HOME=/path/a:/some/other/path


Some more input however would be nice.

[EDIT: fixed a broken tag]
 
Old 01-29-2003, 01:14 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you can't put it there. if your program takes in an environmental variable then it will naturally have to deal with the contents of it, maybe you could develop your program to deal with having two directories in a variable. that'd be a pretty hacky approach. the whole thing here is that that's just not the way program deal with situations like this. you would typically be able to specify a configuration file other than the default one.

the example i gave about opening a new shell for each is based around scope. presumably you are aware of scope issues with your programming, and it's exactly the same outside the program, you would set the variable local only to that shell instance, not the entire system.

so you can have two different environmental varaibles existing within seperate scopes.
 
Old 01-30-2003, 01:02 AM   #9
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
acid_kewpie
The reason why I need to instances is that I need the old version of the product running in the same time as the new.. So customers can see what new enhancements is done with the new product. But since GGM2 is an upgrade of GGM1 it uses the same path. I will try the separate code suggestion..

0x0001
What kind of input do you need…?
 
Old 01-30-2003, 04:05 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
fundamentally you can't have two variables of the same name in the same scope. you either need a different varaibale name or a different scope, and it seems that only the latter is possible. but then like i said a config file would be more traditional
 
Old 01-30-2003, 04:46 AM   #11
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
acid_kewpie
fundamentally you can't have two variables of the same name in the same scope. you either need a different varaibale name or a different scope, and it seems that only the latter is possible. but then like i said a config file would be more traditional
You mean: I cannot have one variable pointing at two different paths?
What is “scope”?
Also I wrote wrong in my last contribution. I meant GGM2 is an upgrade of GGM1 it uses the same variable and the path is different.
Anyway my linux did not make any complaints when I had a : mark in between the paths. Now I need to configure my files and then I will see if it works..

Thanks in advance
 
Old 01-30-2003, 05:24 AM   #12
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
I want to be the proverbial fly on the wall to see AQ when he is replying to this thread

Maybe move it to programming and someone else will chime in with suggestions? And change the name, 2 homes I thought it was going to be about connecting your LAN to your buddy's or can I use my ISP when I'm on vacation or something like that.
 
Old 01-30-2003, 08:36 AM   #13
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
I have finally solved it, thanks for all the help.

To export one variable to two different paths was quite easy in the end. First write the first one and on the row beneath write the second one in this profile.local file. And then export it.
Then of course make all the correct changes in all the configuration files affected..

Thanks for trying!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba [homes] dir problem mmowchenko Linux - General 1 11-03-2005 10:04 PM
Mapping Homes directory in Samba mheymann Linux - Networking 1 08-05-2005 01:34 PM
Migrating users and homes to new server anthonykirk Linux - Hardware 3 06-11-2004 03:18 PM
help me with samba homes please.. brasuca Linux - Networking 3 04-28-2004 06:23 AM
homes directory with NT4 domain tisource Linux - Networking 0 07-03-2002 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration