I have the coolest BASH prompt in all the land

Discussion in 'OT Technology' started by geekierthanyou, Jan 30, 2009.

  1. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    [​IMG]

    Notice what happens when I type a bad command :)
     
  2. lightsareout

    lightsareout New Member

    Joined:
    Aug 19, 2006
    Messages:
    5,913
    Likes Received:
    0
    Location:
    Murfreesboro, TN
    you are geekier than me
     
  3. zanyspy_dude

    zanyspy_dude King of teh n00bz

    Joined:
    Aug 29, 2002
    Messages:
    4,473
    Likes Received:
    0
    Location:
    Indianapolis, IN
    this,but i'd still like to know how that works.
     
  4. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    Amy viewrequests :) $ cat ~/.bash_profile
    # Define how Bash prompt looks like:
    #
    # User @ Host - working dir
    #export PS1=”\u@\h\w$ ”
    export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\e[01;32m:)'; else echo -e '\e[01;31m:('; fi\` \[\e[01;34m\]$\[\e[00m\] "
    # Cli Colors
    export CLICOLOR=1
    # use yellow for dir’s
    export LSCOLORS=exfxcxdxbxegedabagacad

    # history handling
    #
    # Erase duplicates
    export HISTCONTROL=erasedups
    # resize history size
    export HISTSIZE=10000
    # append to bash_history if Terminal.app quits
    shopt -s histappend

    Amy viewrequests :) $
     
  5. zanyspy_dude

    zanyspy_dude King of teh n00bz

    Joined:
    Aug 29, 2002
    Messages:
    4,473
    Likes Received:
    0
    Location:
    Indianapolis, IN
    I always wondered what PS1 was, what is PS2?

    This is so far over my head.
     
  6. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
  7. r00tman

    r00tman Archiver of LOLs

    Joined:
    Sep 23, 2002
    Messages:
    1,989
    Likes Received:
    0
    Location:
    Toronto, ON █♣█
    ...IN ALL THE LAND!
     
  8. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    Exactly!
     
  9. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    So, how much pussy does it get you?
     
  10. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    Well, the shell itself gets me none... but the driving force behind getting the shell working gets me a ton. Women like a man with drive.
     
  11. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    And upgraded!

    Code:
        # Define how Bash prompt looks like:
        #
        # User @ Host - working dir
        #export PS1=”\u@\h\w$ ”
        export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\e[01;32m:)'; else echo -e '\e[01;31m:('; fi\` \[\e[01;34m\]$\[\e[00m\]"
        
        # Cli Colors
        export CLICOLOR=1
        # use yellow for dir’s
        export LSCOLORS=exfxcxdxbxegedabagacad
    
        # history handling
        #
        # Erase duplicates
        export HISTCONTROL=erasedups
        # resize history size
        export HISTSIZE=10000
        # append to bash_history if Terminal.app quits
        shopt -s histappend
        
    function set_window_and_tab_title
    {
        local title="$1"
        if [[ -z "$title" ]]; then
            title="root"
        fi
    
        local tmpdir=~/Library/Caches/${FUNCNAME}_temp
        local cmdfile="$tmpdir/$title"
    
        # Set window title
        echo -ne "\033]0;`pwd`\007"
    
        # Set tab title
        if [[ -n ${CURRENT_TAB_TITLE_PID:+1} ]]; then
            kill $CURRENT_TAB_TITLE_PID
        fi
        mkdir -p $tmpdir
        ln /bin/sleep "$cmdfile"
        "$cmdfile" 10 &
        CURRENT_TAB_TITLE_PID=$(jobs -x echo %+)
        disown %+
        kill -STOP $CURRENT_TAB_TITLE_PID
        command rm -f "$cmdfile"
    }
    
    PROMPT_COMMAND='set_window_and_tab_title "${PWD##*/}"'
    
    Which changes the tab names, as WELL as the whole window title (in OS X)
     
  12. CodeX

    CodeX Guest

    So... you like living in the 80's?
     
  13. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    i like having my tools work for me?
     
  14. CodeX

    CodeX Guest

    Your tools:
    [​IMG]

    Mine:
    [​IMG]
     
  15. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    dont you mean windowspaperclip.jpg?
     
  16. CodeX

    CodeX Guest

    I remember when I was 8, and I was first learning to program in C++, I set up my IDE to have a black background and yellow text with blue syntax highlighting and I thought I was so badass... When I was 8.

    But even then I didn't use the fucking command line lol. You're stuck in the past.
     
  17. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,447
    Likes Received:
    12
    wake up mods. ban codex for constant threadcrap. this is an example.
     
  18. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    what was that, like 1-2 years ago?
     
  19. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    Wait, you are too good for command line? What language do you program in? For what purpose? What OS do you use for development? I can't believe you can do all your work without any command line...
     
  20. geekierthanyou

    geekierthanyou Crews: DSLR, Brolie, Classic Car, Gun, Zombie, Pro

    Joined:
    May 11, 2007
    Messages:
    3,425
    Likes Received:
    0
    Location:
    Covina, CA
    And if you hate command line so much, why would you come into a thread that is specifically geared toward talking about a bash shell?
     
  21. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    ibcodexwalloftext
     
  22. CodeX

    CodeX Guest

    Wake up crontab, having an opinion that you disagree with that is completely on topic is not threadcrapping...
     
  23. CodeX

    CodeX Guest

    That last sentence is sad. Do employers typically not provide decent modern tools?

    To answer your question I typically write C code for an embedded DSP using a proprietary IDE under windows. I also do some C++ and VB.NET in visual studio
     
  24. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    this is awesome, adding to my .bash_profile right now
     
  25. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    The funny part is... he's an embedded developer. And he can only work in windowing systems.

    :rofl::rofl::rofl:
     

Share This Page