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
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
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...
Summary: Typically the problem in cron jobs is that the cron process won't automatically load all the environment variables you take for granted in an interactive session such as $ORACLE_SID, $ORACLE_HOME, $PA...
Summary: Is it possible to pass a Unix environment variable to sed? The example script I have included shows what I am trying to do and the header explains why. I am running this script on Solaris KSh. #######...
Summary: Hi, I have shell script test.sh which calls test.pl and i have test.sh running from crontab - now i am finding test.pl is loosing all the environment variable. I am trying to preserve environmen...