Advertisement

06.12.2003 at 08:37PM PDT, ID: 20646792
[x]
Attachment Details

How to set environment variable in shell script?

Asked by LuRen in Linux Setup

Tags: environment, script, set, variable, shell

hi,

I use redhat 7.3 (2.4.18). But i can't set environment variable
in shell script. please check my code:

=============test==========
#!/bin/bash
CLASSPATH=/usr/test
export CLASSPATH
============================

and in shell, i execute the commands:

# chmod +x test
# ./test

there is no error occured. but when i check use "#set", I can't
find CLASSPATH variable. What's the matter? How can i do?

any help will be very appreciated.

TIA.

-- lr
Start Free Trial
[+][-]06.12.2003 at 08:58PM PDT, ID: 8714635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2003 at 12:34AM PDT, ID: 8715521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.13.2003 at 01:33AM PDT, ID: 8715757

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2003 at 08:45PM PDT, ID: 8722416

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Setup
Tags: environment, script, set, variable, shell
Sign Up Now!
Solution Provided By: jlevie
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.15.2003 at 07:40AM PDT, ID: 8726981

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32