Solved

shell variables

Posted on 2000-03-25
1
271 Views
Last Modified: 2010-07-27
What is the best way to change shell
variables?
0
Comment
Question by:Dereks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 2657411
Well, that depends on what shell you are using and when you want the variables set. From a command line the following apply:

sh       - VAR=my-value; export VAR
bash/ksh - export VAR=my-value
csh/tcsh - setenv VAR my-value

If you want the env vars to be set when you log in, you use the appropriate commands from the above in your shell init files in your home directory, usually:

sh   - .profile
bash - .bashrc
ksh  - .profile
csh  - .cshrc
tcsh - .tcshrc
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cannot rename datastore 3 99
winscp 000webhost.com 6 102
PHP website on Linux - server DNS address could not be found. 18 87
regular expression help for sed command 5 42
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question