LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   newbie programming question (https://www.linuxquestions.org/questions/programming-9/newbie-programming-question-16581/)

aizkorri 03-19-2002 03:31 AM

newbie programming question
 
Hello, I have an app that reads the data from some archives. I want this app to work for all the system, wherever the call is done. For that reason I have put this app in the path, but how can I make it to read from the place that is the data?

In other words, MyApp needs Mydata, but cannot find( I have to "tell" somehow to the app that the data is somewhere or export the data somehow.

HELP...:confused: :confused:

Mara 03-19-2002 04:14 AM

Maybe a configuration file? You can place path to the archives inside.

aizkorri 03-19-2002 04:42 AM

Thanks, I tryed to do something but I am too ignorant.
Well, I have done something like this,
Myexe is in /usr/bin

The file name is DATA.

PATH="$PATH:/usr/bin"
Mydata=/usr/lib/Mydata
export Mydata PATH

(I have no idea, but that is what I think it should be)

Then I do chmod +x DATA,and execute. But Myexe does not find Mydata yet.
Any idea?

kervin 03-22-2002 01:54 PM

even if you 'export' a variable,it's not available in the current shell.

maybe that's what you're running into. Try '. ./DATA'

For instance, if I want to write a script that sets up a bunch of environmental variables in the current prompt before I login, I'd have to run '. /path/to/script'. Notice the preceding '.' followed by a space.

For example , I frequently have to change the CVSROOT enviroment variable before I run the cvs command. The problem is I have multiple CVS trees tracking and a different CVSROOT for each. the '-p' option of cvs can be used, but that's a long command. So I write a script for each source tree eg...

-----
#!/bin/sh
export CVSROOT=".....
------

Then run the script '. ./cvsroot1.sh'

The '. ' specifies that the script runs in the current shell. So you can log yourself out by calling the 'exit' program in one of those scripts for example

aizkorri 03-22-2002 03:39 PM

Thanx, do you believe that I've been changing the configuration file for may be 8 hours. . ./DATA, and thas was all!.


All times are GMT -5. The time now is 05:01 AM.