Operating System - HP-UX
1833198 Members
2786 Online
110051 Solutions
New Discussion

why i need not use export in .profile,but must use export in .dtprofile?

 
常有慈悲心
Regular Advisor

why i need not use export in .profile,but must use export in .dtprofile?



i need not use export in .profile to set
:
HISTFILE=~/.sh_history
HISTSIZE=40

but must use it in .dtprofile
to set these varaiables?

5 REPLIES 5
Cheryl Griffin
Honored Contributor

Re: why i need not use export in .profile,but must use export in .dtprofile?

HISTFILE needs to be exported:
HISTFILE=$HOME/.sh_history; export HISTFILE

Check the user's $HOME/.profile as well as the /etc/profile.

"Downtime is a Crime."
Sunil Sharma_1
Honored Contributor

Re: why i need not use export in .profile,but must use export in .dtprofile?

Hi,

Every variable defined in .profile or profile has to be exported otherwise that will not be available for use in shell.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
常有慈悲心
Regular Advisor

Re: why i need not use export in .profile,but must use export in .dtprofile?

but i find i needn't use "export" command in .profile,
it can work well.
why?
Muthukumar_5
Honored Contributor

Re: why i need not use export in .profile,but must use export in .dtprofile?

IF you are going to CDE based login then,

.profile and /etc/profile will not be executed.

Environment variables related CDE login will be exported in .dtprofile so that particular environment variable will be used on shell usage.

If you did not export environment variables, then it will be local to that script. It can not be accessed for all operations on current shell.

If you are going to use non-CDE login then make settings of HISTFILE environment variables on /etc/profile ( come profile ) or .profile ( user's profile).

HTH.
Easy to suggest when don't know about the problem!
hermesplus
Occasional Advisor

Re: why i need not use export in .profile,but must use export in .dtprofile?

Hello,
uncomment line DTSOURCEPROFILE=true in .dtprofile and will read also the .profile
edi