Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

environment variables

Status
Not open for further replies.

schleife

Technical User
Feb 5, 2001
39
hi all
i am running aix4.3.3 ML 8.
i want to set an environment variable.
i put in /etc/environment: COBDIR=/usr/lpp/cobol
export COBDIR
when i logged in: echo $COBDIR
the COBDIR variable is empty
next i put in /etc/inittab: start:2:wait:/start.ksh
in /start.ksh : COBDIR=/usr/lpp/cobol
export COBDIR
the same result as above.

when i log in and type: . start.ksh
everything is ok.
what is my mistake?

thank's
schleife

 
Try explicitly setting the COBDIR in your .profile, by including the following:

set COBDIR=/usr/lpp/cobol; export COBDIR

Hope this helps.
 
Oops, sorry, this is AIX isn't it. You don't therefore need the set above, just

COBDIR=/usr/lpp/cobol ; export COBDIR

will do.
 
3 things

1. Do not use inittab to set environment variables. Remove that inittab entry ASAP.
2. You can just "export COBDIR=/usr/lpp/cobol"
3. Items in /etc/envronment do not need to be exported.

If you just put "COBDIR="/usr/lpp/cobol" in /etc/environment, it will work fine.

Bill.
 
thank's a lot bjverzal!
whithout exort in /etc/environment it works fine.

schleife
 
"export" will not work from /etc/environment, you should put only VARIABLE=value there to set it up, /etc/profile is for commands for every user
 
Hello,

1) /etc/environment COBDIR=/usr/lpp/cobol
2) /etc/profile
export COBDIR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top