# assume this will be sourced, so no pound-bang-bin-sh
# bprofile


# Joseph Rosevear 170128 I made this by copying and tailoring
# tips/bash_profile.  This file can be sourced by a modified begin. 
# I'm setting up a copy of SAM to run from
# /mnt/150605aa2.

# Joseph Rosevear 171215 I added to this code to learn where it is and to
# call it "bplace".  It then exports and uses bplace.

# Joseph Rosevear 180316 I changed printer in the vostro section.

# Joseph Rosevear 180329 I added definition and export of sam_distro.

# Joseph Rosevear 180329 I changed bplace to sam_root.

# Joseph Rosevear 180329 I cleaned up by removing some in-line comments.

# Joseph Rosevear 180922 I added box vostro-home.



# Announce where we are
echo in $sam_root/bprofile

# Define and export sam_root
sam_root=`dirname $0`
export sam_root

# This is my personal .bash_profile file.  When you apply it to your
# own use you will want to fix these:
#
# umask, TZ, EDITOR, NNTPSERVER, sam_set_version, sam_gui_data,
# sam_temp_base, sam_env, cd_speed, cd_dev

# set mask
# I have been using 067 and initial group, users

# Sam, the SAM maintainer has been using 022 and initial group, users

# Set umask using .SAM.umask
umask `cat $HOME/.SAM.umask`

# Set variables and make some dirs
#
# JHR 170305 I changed the definition of name below.
# name=`basename $HOME`
name=`whoami`
export TZ='America/Los_Angeles'
export EDITOR=exed
export NNTPSERVER=`cat $HOME/.SAM.NNTPSERVER`
#
# These are for SAM
#
#export sam_set_version=1
export sam_set_version=2
#
# Was "export sam_temp_base=/tmp/$name/sam"
# Now "export sam_temp_base=/var/opt/SAM/$name"
# Note that you will need /opt/SAM/tips/rc.SAM in order to use this
# value for sam_temp_base.

# JHR 170128 I changed the line below.
# export sam_temp_base=/var/opt/SAM/$name
export sam_temp_base=/tmp/$name

#
unset glos
#

# export sam_env=$HOME/sam_env
# Joseph Rosevear 171215
export sam_env=$sam_root/sam_env

# Joseph Rosevear 180329
export sam_distro=$sam_root/opt/SAM

#
# This fixes backspace in scripts
stty erase `tput kbs`

#Tailor this for the box
case `cat /var/opt/JBD/box` in

   susie) export cd_speed=1;
          export cd_dev=1,0,0;
          export printer=homebw;;
          
     msi) export cd_speed=1;
          export cd_dev=0,0,0;
          echo .bash_profile: unable to set printer;
          unset printer;;
          
jimel|jimel-sw|prodesk|vostro|vostro-home)
          export cd_speed=1;
          export cd_dev=/dev/sr1;
          #export printer=homebw1d;
          export printer=HomeBW;;
          
round|round-fw)
          export cd_speed=1;
          export cd_dev=/dev/sr0;
          unset printer;;
          
       *) export cd_speed=1;
          echo .bash_profile: unable to set cd_dev;
          unset cd_dev;
          echo .bash_profile: unable to set printer;
          unset printer;;
esac

# Here is a block of code that was in my .bashrc.  Then I learned that
# .bashrc doesn't run in some shells.  So I moved it here.

alias d='dir'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias ls='/bin/ls $LS_OPTIONS'
alias v='vdir'
alias vdir='/bin/ls $LS_OPTIONS --format=long'
alias ldisk='ls -l /dev/disk/by-label'

alias

export PAGER="less -R"
export METAMAIL_PAGER="less -R"
export LESSCHARSET=latin1

# JHR 120825 I changed the line below
# export LS_OPTIONS='--color=auto'
export LS_OPTIONS=' --color=always -F -b -T 0'

# JHR 080220 This was suggested by Alan Hicks It is needed to enable
# backspace in scripts running in xterm in Slackware 12.0, although I
# don't understand why. I hope it doesn't break in other versions of
# Slackware.
if [ "$TERM" = "xterm" ]; then
   stty erase $(tput kbs)
fi

# End of block of code that was in my .bashrc.
