日期:2014-05-16  浏览次数:20609 次

同胞们晒晒.bashrc
先开个头。没有找到shell的code排版,只好借python的一用.
Python code

     1  #########################################################
     2  #           Wed Jul 13 20:38:23 CST 2011                #
     3  #               by Lanceil@NKU                          #
     4  #########################################################
     5
     6  # Check for an interactive session
     7  [ -z "$PS1" ] && return
     8
     9  #########################################################
    10  #                SETTINGS & ALIAS                       #
    11  cd ~/tmp
    12  set -o vi
    13  set -o ignoreeof
    14  setterm -blength 0
    15
    16  PATH=$PATH:/usr/local/bin:~/bin
    17  alias ls='ls --color=auto'
    18  alias ll='ls -l --color=auto'
    19  alias hd='hexdump -C'
    20  alias grep='grep --color'
    21  #                                                       #
    22  #########################################################
    23
    24
    25  #########################################################
    26  #               ENVIRONMENT VARIABLES                   #
    27
    28  PS1="\[\e[34m\][\u@\h\[\e[36m\]\w\[\e[0m\]\[\e[34;m\]]\`if [ \$? = 0 ];\
    29                      then echo -e '\e[32;1m:)'; else echo -e '\e[31;1m:('; fi\`\[\e[0m\]"
    30  LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:\
    31  cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:\
    32  ex=32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:\
    33  *.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:\
    34  *.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:\
    35  *.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:\
    36  *.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:\
    37  *.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:\
    38  *.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:"
    39  TERM=xterm-color
    40  export PS1 LS_COLORS TERM
    41  export LESS_TERMCAP_mb=$'\E[01;36m' # begin blinking
    42  export LESS_TERMCAP_md=$'\E[01;34m' # begin bold
    43  export LESS_TERMCAP_me=$'\E[0m' # end mode
    44  export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
    45  export LESS_TERMCAP_so=$'\E[01;44;33m' # begin standout-odeinfobox
    46  export LESS_TERMCAP_ue=$'\E[0m' # end underline
    47  export LESS_TERMCAP_us=$'\E[36m' # begin underline
    48  #                                                       #
    49  #########################################################
    50
    51
    52  #########################################################
    53  #                   functions                           #
    54
    55  rm()
    56  {
    57          if [ $# -lt 1 ]; then
    58                  echo "trash: missing file operand"
    59                  return 1
    60          fi
    61          mkdir ~/.trash/ 2>&-
    62          mv -f "$@" ~/.trash/
    63  }
    64  um()
    65  {
    66          if [ $# -lt 1 ]; then
    67                  echo "untrash: missing file operand"
    68                  return 1
    69          fi
    70          LASTPWD=$(pwd)
    71
    72          ( cd ~/.trash
    73           mv "$@" $LASTPWD )
    74  }
    75  lm()
    76  { #(
    77          ls -al ~/.trash
    78  } #)
    79  cm()
    80  {
    81          /bin/rm -rf ~/.trash/*
    82  }
    83  #                                                       #
    84  #########################################################



------解决方案--------------------
zsh党表示路过
Python code

 # Created by freetstar at 20101226
 
 ############