From 606ec63191f54758ee5da58caa0677b21f9d03ac Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 23 May 2015 20:23:05 -0400 Subject: bash: Update .bashrc and .bash_profile. --- dotfiles/.bash_profile | 6 ++++-- dotfiles/.bashrc | 28 ++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/dotfiles/.bash_profile b/dotfiles/.bash_profile index f591848..f948a6c 100644 --- a/dotfiles/.bash_profile +++ b/dotfiles/.bash_profile @@ -1,5 +1,7 @@ # -*- shell-script -*- -if [ -f $HOME/.bashrc ]; then source $HOME/.bashrc; fi +# Honor per-interactive-shell startup file +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi -export PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH" +# Search for binaries in user profile /sbin. +export PATH="$HOME/.guix-profile/sbin:$PATH" diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 7112468..8e0622e 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -1,19 +1,31 @@ # -*- shell-script -*- +# Bash initialization for interactive non-login shells and +# for remote shells (info "(bash) Bash Startup Files"). -# If not running interactively, don't do anything -[[ $- != *i* ]] && return +# Export 'SHELL' to child processes. Programs such as 'screen' +# honor it and otherwise use /bin/sh. +export SHELL -# append to the history file, don't overwrite it +if [ -n "$SSH_CLIENT" -a -z "`type -P cat`" ] +then + # We are being invoked from a non-interactive SSH session + # (as in "ssh host command") but 'cat' cannot be found + # in $PATH. Source /etc/profile so we get $PATH and other + # essential variables. + source /etc/profile +fi + +# Append to the history file, don't overwrite it shopt -s histappend -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +# For setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 -# don't put duplicate lines or lines starting with space in the history. +# Don't put duplicate lines or lines starting with space in the history. HISTCONTROL=ignoreboth -# check the window size after each command and, if necessary, +# Check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize @@ -21,5 +33,9 @@ shopt -s checkwinsize # files and zero or more directories and subdirectories. shopt -s globstar +PS1='\u@\h \w\$ ' +alias ls='ls -p --color' +alias ll='ls -l' + # Alias for development guix alias guix="$HOME/Code/guix/pre-inst-env guix" -- cgit v1.2.3