zoukankan      html  css  js  c++  java
  • .bash_profile备份

    # ~/.bash_profile
    
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
        . ~/.bashrc
    fi
    
    # User specific environment and startup programs
    
    none="33[0m"
    black="33[0;30m"
    dark_gray="33[1;30m"
    blue="33[0;34m"
    light_blue="33[1;34m"
    green="33[0;32m"
    light_green="33[1;32m"
    cyan="33[0;36m"
    light_cyan="33[1;36m"
    red="33[0;31m"
    light_red="33[1;31m"
    purple="33[0;35m"
    light_purple="33[1;35m"
    brown="33[0;33m"
    yellow="33[1;33m"
    light_gray="33[0;37m"
    white="33[1;37m"
    
    find_git_branch () {
        local dir=. head
        until [ "$dir" -ef / ]; do
            if [ -f "$dir/.git/HEAD" ]; then
                head=$(< "$dir/.git/HEAD")
                if [[ $head = ref: refs/heads/* ]]; then
                    git_branch="[${head#*/*/}]"
                elif [[ $head != '' ]]; then
                    git_branch="(detached)"
                else
                    git_branch="(unknow)"
                fi  
                return
            fi  
            dir="../$dir"
        done
        git_branch=''
    }
    
    PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"
    PS1="$cyanu$none@$cyanh$none:$greenw$brown$git_branch$none$ "
    
    PATH=$PATH:$HOME/bin
    
    export PATH
  • 相关阅读:
    Wampserver主机服务配置方法
    工作记录
    Shell教程
    简单教程
    java笔记
    四轴飞行器
    ace文档
    马尔科夫模型参考
    电子书搜索
    免费电子书
  • 原文地址:https://www.cnblogs.com/arliang/p/3183560.html
Copyright © 2011-2022 走看看