Home > Linux, Red Hat / CentOS > Starta skript vid inloggning

Starta skript vid inloggning

October 19th, 2010 Leave a comment Go to comments
This is an example how to execute a script at logon to set the Java environment. Add a script named “java.sh” to add the variable in /etc/profile.d/ (with “execute” permissions) if you’re using bash as login shell:
export JAVA_HOME=/usr/java/j2k1.x.x
export PATH=$PATH:$JAVA_HOME/bin
The contents of profile.d will be automatically executed with every interactive logon.
When you logoff your shell will be removed from the memory along with the entire environment. But when you logon again it will be reestablished including your new java environment.
Categories: Linux, Red Hat / CentOS Tags:
  1. No comments yet.
  1. No trackbacks yet.