Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

G'wan, Show us your bash prompt!

  • 30-07-2004 4:07pm
    #1
    Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭


    What Bash (or other) Prompt do you use, and why? Stick it up here! Expose yourself!

    Mine is "\[\033[34m\][\w]\[\033[0m\]$ " For those that can't figure out the escape sequences (:)), it displays the current folder in blue surrounded by square brackets, followed by a black 4 then a space. I like it. The blue makes it easy to see where a command started and it's short and informative.

    Your turn!


Comments

  • Registered Users, Registered Users 2 Posts: 678 ✭✭✭briano


    Minamlist: (Read: Boring)

    \h:>

    I used to have a fancier one, but then I *ahem* ran "shutdown now".

    Not so bad in itself, except I was logged in as root... into the companies file and print server. :eek:

    So Now I need to have the name of the computer there, just to be sure. Although, I'm thinking of a change.


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    I use this so I know who and where I am.
    I use the \# when logged in as root, as it nags me
    about how many commands I've executed as root.
    I used to use a similar one with a \j instead of a \#
    to remind me just how many processes I had running in the background.

    PS1='\u@\h (\#)\w\$ '

    NiallB


  • Technology & Internet Moderators Posts: 28,831 Mod ✭✭✭✭oscarBravo


    PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'

    Gentoo default - user@host in green, basename of the current directory.

    paul@bandler paul $ su -
    Password:
    bandler root #


  • Registered Users, Registered Users 2 Posts: 6,334 ✭✭✭OfflerCrocGod


    It's small but it does me

    #export eth="\$(/sbin/ifconfig | grep eth0 | cut -f1 -d' ')"
    #export ethstatus="\$(if $eth = 'eth0'; then echo $Brown; else echo $Red; fi)"
    export eth="\$(grep $(/sbin/route -n | tail -n 1 | awk '{print $2}') /proc/net/arp | wc -l)"
    export ethstatus="\$(if $eth = 1; then echo $Brown; else echo $Red; fi)"
    export sunrisesec="\$(date -d \$(echo 40.0392 -88.2781 -5 | rscalc -q | head -n 1) +%s)"
    export sunsetsec="\$(date -d \$(echo 40.0392 -88.2781 -5 | rscalc -q | tail -n 1) +%s)"
    export sunstatus="\$(if $sunrisesec -lt \$(date +%s) && \$(date +%s) -lt $sunsetsec; then echo $Yellow; else echo $Cyan; fi)"
    export cmdstatus="\$(if \$? = '0'; then echo $Green; else echo $Red; fi)"
    export rootstatus="\$(if \$(whoami) = root; then echo $Red; else echo $Green; fi)"
    export plugged="\$(acpi -aB | cut -f6 -d' ' | cut -f1 -d-)"
    export pluggedstatus="\$(if $plugged = on; then echo $Blue; else echo $BrightBlue; fi)"
    export powerpercent="\$(acpi -b | cut -f2 -d, | tr -d ' %')"
    export powerstatus="\$(if $powerpercent -lt 2; then echo $White$RedBG; elif $powerpercent -lt 10; then echo $Red; elif $powerpercent -lt 50; then echo $Yellow; else echo $Green; fi)"
    export midload="\$(cut -f1 -d' ' /proc/loadavg | sed -e 's/\.//' -e 's/^0*//')"
    export loadstatus="\$(if $midload -gt 200; then echo $Red; elif $midload -gt 100; then echo $LightRed; else echo $White; fi)"
    export PS1="
    $Purple${VStart}l$VEnd$cmdstatus\!$Reset$Blue[$sunstatus\t$Reset$Blue]$Reset$rootstatus\u$ethstatus@$Reset$powerstatus\h$Reset:\
    $pluggedstatus\w$Reset
    $Purple${VStart}m$VEnd$Yellow\j$Reset$loadstatus\\$ $Reset"


  • Registered Users, Registered Users 2 Posts: 2,518 ✭✭✭Hecate


    Bash, bleh.

    I use ZSH and here's the prompt:

    PS1="$(print '%{\e[1;31m%}(%{\e[0;36m%}%T%{\e[1;31m%}) (%{\e[1;34m%}%25<..<%l%{\e[1;31m%})%{\e[1;33m%} %# %{\e[0m%}')"

    RPS1="$(print '%{\e[0;36m%}%~%{\e[1;31m%}%{\e[0m%}')"

    - shows the current dir on the right hand side.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    set prompt="%m %{^[[1;32;40m%}[%~] %{^[[00;31;40m%}%B%@%b%{^[[0;37;40m%}%#"
    

    from my .tcshrc - don't remember everything it does :) , but it keep me happy. Displays machine name, current directory (relevant to /home if applicable) and current time, with colour.


  • Registered Users, Registered Users 2 Posts: 491 ✭✭Silent Bob


    PS1="[\u@\h \w]\$ "

    Is what I use on my main box.

    Not very imaginative, but there you go.

    I use different colours for the machine name part of my prompt on different machines, to help distinguish between all those ssh sessions :)


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    I don't use this prompt.... but, it looks cool in my sig.


  • Registered Users, Registered Users 2 Posts: 1,419 ✭✭✭nadir


    I should really try some new bash colours

    export IRCNAME="my ph4t n3w ircn4me."
    export PS1="\[\033[1;30m\][\[\033[0;36m\]\h\[\033[1;30m\]]\[\033[1;37m\]\u\[\033[1;30m\]:\[\033[1;36m\]\w\[\033[1;30m\]>\[\033[0m\]"
    alias ls='ls --color'
    alias cp='cp -i' # confirm copy over an existing file
    alias mv='mv -i' # confirm move over an existing file
    alias rm='rm -i' # confirm removing filei
    alias "ls -l"='ls -l --color'
    alias links2='links2 -g -driver fb'
    alias fbmplayer='mplayer -autosync 30 -vo fbdev2 -vf scale=1280:1024'
    alias maek='make'
    export EDITOR=vim


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    nadir wrote:
    alias maek='make'

    Love it :) Happens me too, never thought of making an alias though.


  • Advertisement
Advertisement