# ENVIRONMENT TERM=xterm S_ON=`tput smso` S_OFF=`tput rmso` HOST=`uname -n` TITLE="\033]0;$HOST\007" PS1='$S_ON$LOGNAME@$HOST $PWD>$S_OFF' LITTLE_PROMPT='$S_ON$LOGNAME@${PWD##*/}>$S_OFF' EDITOR=vi VISUAL=vi PATH=$PATH:/usr/lib/wine/bin:~kynan/scripts: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/wine/lib export TERM S_ON S_OFF HOST TITLE PS1 VISUAL EDITOR ENV PATH RXVT_OPTS LD_LIBRARY_PATH stty erase  set -o vi # ALIASES alias ll='ls -la' alias lsd='ls -la | grep ^d' alias ls='ls --color=auto' # FUNCTIONS # myssh : just a wrapper for ssh to redo the xterm title after sshing somewhere myssh() { /usr/bin/ssh $* title $HOST } # bkup : create copies of files passed to it tagged as filename.backup.yymmdd-hhmm bkup() { if [[ $# -gt 0 ]];then while [ "$1" ] do [[ -f "$1" ]] && cp -p "$1" "${1}.backup.`date +%y%m%d-%H%M`" shift done fi } # title : change and xterm title/icon text title() { TITLE=$1 [ "$1" ] || TITLE=$HOST print -n "\033]0;$TITLE\007" } # addup : takes all the files in $1 and adds up the file sizes addup () { ls -l $* |awk '{COUNT=COUNT+$5}END{print COUNT}' } checkport() { [ "$1" ] && awk '/ '$1'\//{print $0}' /home/kynan/docs/port-numbers } # this little if statement fires off if LOG_IT is set and if so it runs # COMMAND vi the script function thus logging all output to LOGFILE if [ -n "$LOG_IT" ];then # unset LOG_IT just in case - might get stuck in a loop unset LOG_IT LOGFILE="/home/kynan/logs/$REMOTE_HOST-`date +%y%m%d-%H%M`.log" script $LOGFILE -f -q -c "$COMMAND" echo "Script finished on `date`" exit fi title $HOST