My mind is dying from sinuses. What I would like to do is change a
subdirectory mentioned in the PATH variable with a different value. In
particular, I have multiple JAVA releases installed. In /etc/profile, I
set JAVA_HOME to the default directory and put JAVA_HOME/bin on the
PATH. I would like to write a simple shell script which changes the
current value of JAVA_HOME to a different value (easy) and change the
JAVA_HOME/bin portion of the PATH to the "new" one, then invoke java.
Something like:
#!/bin/sh
newhome="/java160"
if [ ! -z $JAVA_HOME ]; then
PATH=$(...)
fi
export JAVA_HOME=${newhome}
export PATH={$PATH}:${newhome}/bin
What I want in the ... portion is to erase ${JAVA_HOME}/bin along with
appropriate semi-colon separator (i.e. trailing if JAVA_HOME/bin is the
first on the list, otherwise leading).
I was thinking of something like sed, but just cannot get my brain to
work very well today.
Should I just give up and not set a default, but create a "java" shell
script to invoke java? Oh, and I guess the same for javac, but that is
not as critical for me.
What I really wish that I could do would be to "source" some file which
would do the same so that the "default" java for that user would be
changed until some over "java selection" script was sourced. Is this
possible?
Thanks for any ideas. Maybe if I get over this sinus attack next week, I
may figure it out myself.
--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology
The information contained in this e-mail message may be privileged
and/or confidential. It is for intended addressee(s) only. If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense. If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390