1825720 Members
3137 Online
109686 Solutions
New Discussion

alias in .profile

 
SOLVED
Go to solution
Frans Heckman
New Member

alias in .profile

Hello all,

I've created a .profile in my login directory.
Changed the .dtprofile and added:
DTSOURCEPROFILE=true
This seems to have worked, because the system variables in the .profile have been read, but the aliases I put in don't work. The syntax is ok. and if I run the .profile manually after login the aliases are active.
I don't understand this. Is the .profile being read during login or not. How is it possible, that some of it is read and some of it not ?
Gratefull for any response.
Regards,
Frans
5 REPLIES 5
Alex Glennie
Honored Contributor
Solution

Re: alias in .profile

Try this : open the dtterm with -ls on the command line eg :

dtterm -ls (loginShell) does it now work ?

To make permantent and for ALL terminals :

vi $HOME/.Xdefaults

*loginShell : True

exit CDE and log back in for changes to take effect : see man dtterm etc for full explanation but this is expected behaviour, CDE only sources .profile at login once.
Pete Randall
Outstanding Contributor

Re: alias in .profile

Frans,

As a general rule, I put alias info in the .rc file for the respective shell: .kshrc, for example.


Pete



Pete
Frans Heckman
New Member

Re: alias in .profile

right on!
Thanks Alex.
Regards,
Frans
Jean-Louis Phelix
Honored Contributor

Re: alias in .profile

Pete is right. In general, aliases are not exported and .profile is only executed by the login shell. That's why we often use in sh or ksh :

- $HOME/.profile for variables which are exported including ENV a special one to specify a script to be executed by all subshells

. $HOME/.kshrc (most common value for $ENV). From man sh-posix which you should check, "This file is typically used for alias and function definitions."

Regards.
It works for me (© Bill McNAMARA ...)
Bill Hassell
Honored Contributor

Re: alias in .profile

Tye terminal windows (hpterm, xterm, dtterm) by default do not follow the Unix standard for login, that is, read /etc/profile and then .profile (assuming standard POSIX shell for the user). The easiest way to fix this behavior is to set the loginShell resource. This can be done by customizing the startup for terminal windows in CDE by adding -ls but it is easier to set the loginShell resource for all the terminal windows in .Xdefaults as in:

echo *loginShell: true" >> $HOME/.Xdefaults

You can set additional resources to make terminal windows more palatible:

Here are some additional resources that make terminal windows more palatible:

HPterm*background: navy
HPterm*foreground: white
HPterm*saveLines: 10s
HPterm*scrollBar: true

Xterm*background: darkslateblue
Xterm*foreground: white
Xterm*saveLines: 10s
Xterm*scrollBar: true

Dtterm*saveLines: 10s
Dtterm*scrollBar: true

Of course, the colors can be changed to any value and you can also set the terminal's character geometry (lines/columns) and the physical size in pixels.


Bill Hassell, sysadmin