Go Back   DaemonForums > Miscellaneous > Off-Topic

Off-Topic Everything else.

Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 31st May 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
Join Date: May 2008
Location: USofA
Posts: 1,546
Default What does your .*shrc file look like?

What does your shells initialization file look like?

On my systems, the individual shells own profile/shrc's just source this through . or ENV.

# vim: set ft=sh :

# default file permissions -rw------- / drwx------
umask 077

# set my standard environment settings
PATH="/bin:/sbin:/usr/bin:/usr/sbin"; export PATH

# locale related settings
TZ='Etc/UTC'; export TZ                 # my time zone
LANG='en_US.UTF-8'; export LANG         # language.encoding
# some programs require us to set LC_ALL manually as well.
LC_ALL='en_US.UTF-8'; export LC_ALL
BLOCKSIZE='M'; export BLOCKSIZE         # prefer megabytes over 512 byte blocks

# set my pager
if [ -x /usr/bin/less ]; then
    PAGER='/usr/bin/less'; export PAGER
    LESS='-FiJqX'; export LESS  # default options to less
    PAGER="more"; export PAGER

# set my default editor, on order of preference and create aliases
if [ -x /usr/local/bin/vim ]; then
    EDITOR='/usr/local/bin/vim'; export EDITOR
    VISUAL='/usr/local/bin/vim'; export VISUAL
    if [ -x /usr/local/bin/view ]; then
        # I prefer Vim to Vi when 'view'ing a file
        alias view='/usr/local/bin/view'
elif [ -x /usr/bin/vi ]; then
    EDITOR='/usr/bin/vi'; export EDITOR
    VISUAL='/usr/bin/vi'; export VISUAL
    # on some systems where vim is not installed, I tend to type vim
    alias vim='/usr/bin/vi'
elif [ -x /usr/bin/mg -o /usr/local/bin/mg ]; then
    # Micro GNU Emacs is 
    EDITOR="`which mg`"; export EDITOR
    VISUAL="`which mg`"; export VISUAL
    alias microemacs='mg'

case `uname -s` in
    'FreeBSD') isFreeBSD=1
               LSCOLORS='CxGxxxxxBxexExcxdx'; export LSCOLORS
               ;; # FreeBSD
    'OpenBSD') isOpenBSD=1;;
    'NetBSD')  isNetBSD=1;;
    'Linux')   isLinux=1;;
    'Unix')    isUnix=1;;

case `basename $SHELL` in
    'sh') # older versions of the bourne shell lack line editing (i.e. < sys 3)
          [ $isFreeBSD ] || [ $isOpenBSD ] ||
          [ $isNetBSD ] || [ $isLinux ]  &&  set -o emacs
          # set prompt
          PS1="`hostname -s`$ "; export PS1
          ;; # sh
          # prompt is: [ user@host:pwd ]$
          PS1="[ \u@\h:\w ]$ "; export PS1
          set -o emacs
          ;; # bash
    'ksh'| 'ksh93'| 'pdksh')
          # my standard issue prompt
          PS1="$USER@`hostname -s`-$ "; export PS1
          set -o emacs
          ;; # ksh family
    'zsh') # set my various options
           setopt appendhistory autocd extendedglob
           # dont' beep !
           unsetopt beep
           # emacs bindings
           bindkey -e
           zstyle :compinstall filename "$HOME/.zshrc"
           autoload -Uz compinit
           # COLORS
           # I like color in my zsh prompt ;-)
           PS1="$USER@%B%m%b${fg_green}$ ${fg_no_colour}"; export PS1
           # display the (24h) time in the right-prompt`
           RPS1="%T"; export RPS1

# define some standard aliases for programs, should be fairly portable where
# said programs are installed.
alias   bye="echo 'bye'; exit"
alias   cls='clear'
alias   pgr="$PAGER"
alias   limeric='fortune /usr/share/games/fortune/limerick'
alias   gcc='gcc -Wall -W -Wpointer-arith -Wbad-function-cast -std=c99'
alias   gcc_wall= 'gcc -Wall -Wpointer-arith -Wcast-qual -Wcast-align \
                   -Wconversion -Waggregate-return -Wstrict-prototypes \
                   -Wmissing-prototypes -Wmissing-declarations \
                   -Wredundant-decls -Winline -Wnested-externs -std=c99 \
                   -march=i686 -pipe'
alias   gcc_optimize='gcc -fforce-mem -fforce-addr -finline-functions \
                           -fstrength-reduce  -floop-optimize -O3'
alias   gcc_debug='gcc -ggdb3'
# this quick lint works on both FreeBSD and OpenBSD anyway (ansi mode)
alias   lint='lint -cehzs'
# lint's -H option is not documented on FreeBSD but works on both FreeBSD and
# OpenBSD, dunno about other lints.
alias lint_ansi='lint -aaabcehHzs'

# define system specfic aliases for common commands
if [ $isFreeBSD ]; then
    # The FreeBSD system seems to have been made by people that have an "Hey
    # we've been using this command prompt for the past 30 years, let's tmake it
    # comfortable!" approch...  Thus it needs it's own set of aliases.

    alias   cp='cp -ivRL'
    alias   mv='mv -v'
    alias   ls='ls -FGH'
    alias   ll='ls -laFhHo'
    alias   la='ls -aFG'
    alias   rm='rm -d'
    alias   rmdir='rmdir -v'
    # quick command to mute the sound system
    alias   mute='mixer pcm 0:0'
elif [ $isOpenBSD ]; then
	alias 	cp='cp -iRL'
	alias 	ls='ls -F'
	alias 	ll='ls -laFho'
	alias 	la='ls -aF'
	alias 	rm='rm -d'
elif [ $isLinux ]; then 
    echo "No aliases set..."
    # define fail safe aliases that should work on most systems
    alias   ll='ls -l'
    alias   la='la'

# give a fortune cookie and the current date/time on login
[ -x /usr/games/fortune ] && /usr/games/fortune -aes
echo ''

echo ''; echo -n 'To days date is: '; date

# parse site local additions
. ${HOME}/.site_shrc
site_shrc defines things specific to the current machine, I find it useful for adjusting the environment variables:

${HOME}/.site_shrc on this laptop:
# vim: set ft=sh :

# TeX Live stuff
PATH="/usr/Programs/texlive/2007/bin/i386-freebsd:$PATH:/usr/local/bin:/usr/local/sbin:${HOME}/sh:${HOME}/bin"; export PATH
MANPATH="/usr/Programs/texlive/2007/texmf/doc/man:/usr/share/man:/usr/local/man:$MANPATH"; export MANPATH
INFOPATH="/usr/Programs/texlive/2007/texmf/doc/info:/usr/share/info:/usr/local/info:$INFOPATH"; export INFOPATH

# QT: needed in order to compile QT programs...
export QMAKESPEC='freebsd-g++'
export QTDIR='/usr/X11R6/include/'

# for NPM
export SVNROOT='<snip>'

# for sudo pkg_add
PACKAGEROOT="ftp://ftp13.us.FreeBSD.org/"; export PACKAGEROOT

alias	paxhelp='paxhelp | pgr'
alias	scp2v='scp -P <snip> -i ~/.ssh/<snip>'
alias 	ssh2v='ssh -p <snip> <snip>@vectra -i ~/.ssh/<snip>'
alias   ssh2npm='<snip>'
alias 	gcj='gcj43'

# Our IP Address, doesn't work in older bourne shells
if [ -x /usr/bin/perl ]; then
	MY_IP=$(ifconfig ath0 | grep 'inet' | awk '{print $2}')


I've used FreeBSD since November 2005.
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
File system at more than 100% michaelrmgreen FreeBSD General 4 28th July 2008 01:52 PM
file:/// mfaridi FreeBSD Security 3 27th July 2008 02:18 PM
Help with tcpdump file brokensilence General software and network 2 10th July 2008 03:45 PM
VSFTPd: pid file kostromin FreeBSD Ports and Packages 0 4th July 2008 08:35 AM

All times are GMT. The time now is 08:17 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick