Philip Guenther <[email protected]> wrote:

> On Sun, Apr 20, 2014 at 9:47 PM, Nex6|Bill <[email protected]> wrote:
> > Kinda new to OpenBSD, (have a couple of 5.4 installs in VMs); whats the \
>   standard for alias's? i added it to the .profile but some googling seems \
>   to
> > indicate that that wont work. that you have to export, and do an .kshrc \
>   file? so whats the "standard?"
> 
> As Eric noted, reading the ksh(1) manpage is a start.
> 
> My rule of thumb is that shell settings fall into two groups:
>  * those that are inherited or only need to be done once per session:
> environment variables, umask, stty settings
>  * those that need to be done by each shell process: shell functions,
> aliases, unexported variables, bind changes
> 
> The former go in your .profile.  The latter go in a file of your
> choice which you point the ENV variable at, which you export in your
> .profile.  So:
> 
> .profile:
> umask 002
> export ENV=~/.kshrc
> export PAGER=less
> export HOSTNAME=$(hostname)
> stty -ixon -ixoff ixany status ^T
> 
> 
> .kshrc:
> l() { ls -la "$@"; }
> PS1=": ${HOSTNAME%%.*}; "
> 
> and so on.
> 
> Philip Guenther

I'm going to add that .profile may be read by non-terminal login software
(xdm, etc.) as well, so it's not a bad idea to limit terminal
initialization stuff to interactive login sessions:

# tset on interactive login shells.
case "$-" in
*i*)
        eval `tset -sQ '-munknown:?vt220' $TERM`
        ;;
esac

Putting things in the wrong shell init files can result in things not
working as they should, so please be careful and follow the advice to
read ksh(1).

- Martin

Reply via email to