LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2002, 03:31 AM   #1
aizkorri
Member
 
Registered: Feb 2002
Location: Basque Country
Distribution: Fedora 14, Ubuntu 14.04
Posts: 434
Blog Entries: 1

Rep: Reputation: 55
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...
 
Old 03-19-2002, 04:14 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Maybe a configuration file? You can place path to the archives inside.
 
Old 03-19-2002, 04:42 AM   #3
aizkorri
Member
 
Registered: Feb 2002
Location: Basque Country
Distribution: Fedora 14, Ubuntu 14.04
Posts: 434

Original Poster
Blog Entries: 1

Rep: Reputation: 55
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?
 
Old 03-22-2002, 01:54 PM   #4
kervin
Member
 
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 31
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
 
Old 03-22-2002, 03:39 PM   #5
aizkorri
Member
 
Registered: Feb 2002
Location: Basque Country
Distribution: Fedora 14, Ubuntu 14.04
Posts: 434

Original Poster
Blog Entries: 1

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c newbie programming kpachopoulos Programming 1 03-24-2005 04:46 PM
Graphics programming newbie question R00ts Programming 4 06-21-2004 05:21 PM
Programming Newbie tipaul Slackware 3 08-05-2003 05:37 PM
Newbie question> Programming with C Juan Araya Slackware 2 03-06-2003 08:41 PM
Programming newbie trusouthrnplaya Programming 13 07-25-2001 03:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:25 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