freebsd-src/share/skel/dot.profile
Edward Tomasz Napierala b4b61ead7e dot.profile: handle symlinked $HOME
Reapply 4cea05a273:

    Make sh(1) recognize the default $HOME.  By default /home
    is a symlink; without this change, when you log in, sh(1)
    won't realize the current directory (eg '/usr/home/test')
    is the same as $HOME ('/home/test').

/home is no longer a symlink by default, but new users may be added on
systems that started out with an earlier version of FreeBSD (and still
have /home as a symlink) or admins may do so.

This test is not particularly expensive, so just restore it.

Suggested by:	danfe, brooks
2024-02-13 13:24:22 -05:00

30 lines
966 B
Plaintext

#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#
# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
# Setting TERM is normally done through /etc/ttys. Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# TERM=xterm; export TERM
EDITOR=vi; export EDITOR
PAGER=less; export PAGER
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
# Let sh(1) know it's at home, despite /home being a symlink.
if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
# Query terminal size; useful for serial lines.
if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
# Display a random cookie on each login.
if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi