From a53ff5b0b6601c61e10a4e3d746acbff4349a0a1 Mon Sep 17 00:00:00 2001 From: Ken-ichi Mito Date: Sat, 14 Apr 2018 17:44:50 +0900 Subject: [PATCH] update bashrc - unset history max size - use ssh-agent with screen - from http://www.gcd.org/blog/2006/09/100/ - add $HOME/bin to $PATH if it exists --- TipAndDoc/.bashrc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/TipAndDoc/.bashrc b/TipAndDoc/.bashrc index fd11a78..1306c0c 100644 --- a/TipAndDoc/.bashrc +++ b/TipAndDoc/.bashrc @@ -4,9 +4,6 @@ ulimit -c 0 # no dump core export PAGER=less export LESS='-FRX -i -P ?f%f:(stdin). ?lb%lb?L/%L.. [?eEOF:?pb%pb\%..]' -HISTSIZE=50000 -HISTFILESIZE=50000 - set -o notify # notify end of background job immediately shopt -s histappend # append command history instead of overwrite @@ -33,6 +30,22 @@ else export PS1='\u@\h:\w\$ ' fi +agent="$HOME/.ssh/ssh-agent-$USER" +if [ -S "$SSH_AUTH_SOCK" ]; then + case $SSH_AUTH_SOCK in + /tmp/*/agent.[0-9]*) + ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent + esac +elif [ -S $agent ]; then + export SSH_AUTH_SOCK=$agent +else + echo "no ssh-agent" +fi + +if [ -d "$HOME/bin" ]; then + PATH="$HOME/bin:$PATH" +fi + alias vi='vim' alias sudo='sudo -H ' alias rm='rm -v' -- 1.7.9.5