Ticket #13384: profile.diff

File profile.diff, 1.1 KB (added by mirabilos, 7 years ago)

diff for /etc/profile

  • /etc/profile

    old new  
    33# Place user customizations in /.profile
    44#
    55
    6 ps |& grep -e $PPID |& grep -e $SHELL |& grep -q -e $PPID > /dev/null 2>&1
     6ps 2>&1 | grep -e $PPID 2>&1 | grep -e $SHELL 2>&1 | grep -q -e $PPID > /dev/null 2>&1
    77if [ $? -eq 1 ] ; then
    88    echo -e "\nWelcome to the Haiku shell.\n"
    99    export PS1="\w> "
     
    3535alias la="ls -A"
    3636alias m="more"
    3737
    38 shopt -s checkwinsize
     38test -n "$BASH_VERSION" && shopt -s checkwinsize
    3939
    4040#
    4141# and now we include a few useful things...
     
    5151# Chet Ramey
    5252# chet@ins.CWRU.Edu
    5353#
    54 whence()
     54test -n "$KSH_VERSION" || whence()
    5555{
    5656    local vflag= path=
    5757
     
    106106    return $returnValue
    107107}
    108108
    109 alias which='whence'
     109if test -n "$KSH_VERSION"; then
     110    ps1_pwd() {
     111        local e=$? d=${PWD:-?}/ p=~
     112        [[ $p = ?(*/) ]] || d=${d/#$p\//\~/}
     113        print -nr -- "${d%/}"
     114        return $e
     115    }
     116    PS1=${PS1/'\w'/'$(ps1_pwd)'}
     117    alias which='whence -p'
     118else
     119    test -n "$BASH_VERSION" || PS1=$(printf '%s' "$PS1" | \
     120        sed 's/\\w/$PWD/')
     121    alias which='whence'
     122fi
    110123
    111124function dir {
    112125    ls -lF "$@";