Computing.Net > Forums > Unix > set environment variables on Korn, C She

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

set environment variables on Korn, C She

Reply to Message Icon

Name: Sony Lloyd
Date: June 29, 2001 at 05:34:27 Pacific
Comment:

why sometimes I can use:
- export $VARIABLE=value
(ie: export $HOME=/users)
and some other times:
- export VARIABLE=value
(export HOME=/users)
or:
- export VARIABLE="value"
(export="/users")
NB: Are the 3 ways ok, yes or no?
Are they valid for both Korn and Bourne Shells?
******
On C Shell, how come it's sometimes :
- setenv
and sometimes
- set variable=(value)
Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Jon L
Date: June 30, 2001 at 01:54:17 Pacific
Reply:

There is more than one way to do something. ;) CSH will accept both setenv or set variable=value use whichever you like.

bourn shell does not like export $VAR=value you need to add export $var as the next statement for it to take effect.

It is ok to use the quotes as well. This is usually done if you have any special character that has some function. The quotes simply tell the system to ignore it's special function and use the character as part of the value.

Hope this helps a little bit.


0

Response Number 2
Name: Paul N
Date: March 15, 2002 at 11:49:57 Pacific
Reply:

Taking this further...I am trying to set a "complex variable in IRIX

example in Solaris
FS1="1 / /dev/rdsk/c0t0d0s0"
I need to be able to call the different parts of this variable seperately...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: set environment variables on Korn, C She

How to set environment variable www.computing.net/answers/unix/how-to-set-environment-variable/5689.html

Pass environment variables to sed www.computing.net/answers/unix/pass-environment-variables-to-sed/7387.html

Preserving env variable inside perl www.computing.net/answers/unix/preserving-env-variable-inside-perl/7176.html