LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-15-2004, 04:52 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
Saving User-Created Variables


which conf file do i edit to save User-Created Variables ?
 
Old 02-15-2004, 06:27 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Bash, C, C++, Perl, ... ?
Persistent Objects?


Cheers,
Tink
 
Old 02-15-2004, 07:45 PM   #3
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
bash!
 
Old 02-15-2004, 09:56 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I don't think that there is a "config file" you can
edit to achieve automatic saving of environment
variables. The user would have to actively put
the variables he needs preserved into either
.bashrc or ./bash_profile (depends on how you
invoke bash, "man bash" for details) to have
them "preserved" between sessions.


If you want to have a bash-script get specific
variables between sessions, write & read them
to/from files.


Code:
my_exit()
{
   echo $MY_VAR_1 > ~/.my_var_1
   exit
}

my_init()
{
   export MY_VAR_1=`cat ~/.my_var_1`
}
and so forth ...


Cheers,
Tink
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
saving newly created files using ftp on a network linuxhippy Slackware 5 05-06-2005 03:54 AM
HELP! When I create a new user a home dir isn't created lynchpin9 Linux - General 5 01-18-2005 11:05 AM
I cant login using an user I haveve created! ssobeht Slackware 2 08-20-2004 08:02 AM
I can't login with newly created user r_ibsen Linux - Newbie 2 06-19-2004 08:32 AM
Newly created user can't run kde neeyo Linux - General 4 04-11-2002 03:29 PM

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

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