Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

shell variables

Posted on 2000-03-25
1
Medium Priority
?
274 Views
Last Modified: 2010-07-27
What is the best way to change shell
variables?
0
Comment
Question by:Dereks
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 150 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

885 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