#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#
# modified by nab
# sourced from .bashrc (applied for NOT login shells)
########################################
# terminal & shell setting
# (prompt setting are set in .shrc or .bashrc)
stty erase ^H
umask 022
export ENV=$HOME/.shrc
export TERM="xterm"
#export TERM="rxvt"
#export TERM="xterm-color"
#export TERM="kterm-color"
# language & i18n settings
# export LANG=ja_JP.eucJP
unset LANG
export LC_ALL=ja_JP.eucJP
# PATH
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#if [ -d /usr/libexec ]; then PATH=$PATH:/usr/libexec; fi
#if [ -d /usr/local/libexec ]; then PATH=$PATH:/usr/local/libexec; fi
if [ -d /usr/X11R6/bin ]; then PATH=$PATH:/usr/X11R6/bin; fi
if [ -d /usr/X11R6/libexec ]; then PATH=$PATH:/usr/X11R6/libexec; fi
if [ -d /var/qmail/bin ]; then PATH=$PATH:/var/qmail/bin; fi
if [ -d /usr/local/pkg/diable-jdk ]; then
PATH=$PATH:/usr/local/pkg/diable-jdk/bin; fi
if [ -d /usr/local/pkg/openoffice ]; then
PATH=$PATH:/usr/local/pkg/openoffice/bin; fi
if [ -d $HOME/bin ]; then PATH=$HOME/bin:$PATH; fi
# MANPATH
# - basic settings are defined in /etc/manpath.conf
#
#export MANPATH=".:/usr/local/man:/usr/share/man"
#if [ -d /usr/X11R6/man ]; then MANPATH=$MANPATH:/usr/X11R6/man; fi
if [ -d /var/qmail/man ]; then MANPATH=$MANPATH:/var/qmail/man; fi
if [ -d /usr/local/ja_JP.EUC/man ]; then
MANPATH=$MANPATH:/usr/local/ja_JP.EUC/man; fi
if [ -d $HOME/man ]; then MANPATH=$MANPATH:$HOME/man; fi
########################################
# program specified settings
#
# cvs
if [ `hostname` == "hostname" ]; then
export CVSROOT=/cvs/root
else
export CVSROOT=:ext:nab@cvsserver://cvs/root
export CVS_RSH=ssh
fi;
export RSYNC_RSH=ssh
# X with ssh connection
#eval `ssh-agent -s` >/dev/null
#if [ "$SSH_CLIENT" ]; then
# IP=`echo "$SSH_CLIENT" | sed -e 's/ [0-9]* [0-9]*$//'`
# #echo "export DISPLAY=$IP:0.0"
# export DISPLAY=$IP:0.0
#fi
# text viewer & editor
#export JLESSCHARSET=japanese-ujis
if [ -x "`which more`" ]; then export PAGER=more; fi
if [ -x "`which less`" ]; then export PAGER=less; fi
if [ -x "`which jless`" ]; then export PAGER='jless -s'; fi
if [ -x "`which vi`" ]; then export EDITOR=vi; fi
if [ -x "`which vim`" ]; then export EDITOR=vim; fi
export JLESSCHARSET=japanese
export LESS='-X -i -P ?f%f:(stdin). ?lb%lb?L/%L.. [?eEOF:?pb%pb\%..]'
# etc
export WRKDIRPREFIX=/tmp
#export XMAMEROOT
########################################
# interactive mode
if [[ "$PS1" ]]; then
########################################
# alias
# for basic command
alias ll='ls -laFo'
alias la='ls -Fa'
alias ls='ls -F'
alias su='su -m'
#alias su='su -l'
alias h='fc -l'
alias j='jobs -l'
alias l=$PAGER
alias g='egrep -i'
alias sc='screen'
alias s='screen -x'
# be paranoid
alias cp='cp -ip'
alias mv='mv -i'
alias rm='rm -i'
# replace command
alias vi='$EDITOR'
alias view='$EDITOR -R'
alias memo='$EDITOR $HOME/memo/memo'
alias shout='$EDITOR $HOME/memo/shout'
alias butu='$EDITOR $HOME/memo/butuyoku'
alias diary='$EDITOR $HOME/memo/diary.txt'
alias pd='$EDITOR $HOME/memo/password'
alias less='$PAGER'
if [ -x "`which jman`" ]; then alias man='jman'; fi
if [ -x "`which jgrep`" ]; then alias grep='jgrep'; fi
if [ -x "`which gawk`" ]; then alias awk='gawk'; fi
if [ -x "`which w3m`" ]; then
alias w3m='w3m -B'
alias w3m2='w3m -B -bookmark ~/xxx/bookmark/index.html'
fi
if [ -x "`which xli`" ]; then alias xli='xli -fullscreen -cdither'; fi
if [ -x "`which opera-devel`" ]; then alias opera='opera-devel'; fi
if [ -d "/usr/local/share/vim/chalice" ]; then alias chalice='vim -c Chalice';
fi
if [ -x "`which openoffice.org`" ]; then alias oo='mlterm -e openoffice.org';
fi
fi