This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Export automatically...

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 24575
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic