Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Export automatically...

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, in windows XP, you could set the environment variable PATH to remember the java bin directory... In windows 98 or later, you could use the set path command... In Linux, we use the export command. But I don't want to do this everytime I start my computer. Any idea on how to get around this problem? I have heard of editing the profile but couldn't find the right sources to teach me how to do that... Thanks!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put those kinds of definitions into your shell resource file. That's located in your home directory, and called something like ".tcshrc" (for the TCSH shell) or ".bashrc" (for the bash shell) or something similar. THose get executed automatically when a new shell starts.
If you put it into the ".profile" file (also in your home directory), it will be executed no matter what shell you use (if I remember correctly, haven't actaully tried that myself).
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on your linux-flavour, different files might be appropriate.
To investigate, which file is used for your linux, you could search where the path is set so long:

Top-candidates are /etc/profile and /etc/bash.bashrc
For these system-wide configuration-files you need to be root to write to them.
Insert

with your favourite editor.

You don't need the 'export' if it is called later in the file.

If different users of the machine need different settings, the situation is more complicated.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's actually probably about 5 different places you can set profile info, depending on whether you want it known to a single user or all users, what shells you want affected, and so forth. It takes a little digging, but it's there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic