Loading ...
Sorry, an error occurred while loading the content.

Re: Shell prompt of Busybox

Expand Messages
  • JMVDWYM
    Gilbert, In case you didn t figure this out yet, for my UnSLUNG box I edited my ~/.bash_profile and added: #~/.bashrc is run AFTER .bash_profile! alias dir=ls
    Message 1 of 2 , Nov 26, 2006
    • 0 Attachment
      Gilbert,

      In case you didn't figure this out yet, for my UnSLUNG box I edited my
      ~/.bash_profile and added:
      #~/.bashrc is run AFTER .bash_profile!
      alias 'dir=ls -aFlg'

      #Don't know why .bashrc isn't run automatically...(should probably
      have -f check first...)
      ~/.bashrc

      #Set some colors & tweak titlebar if terminal (like PuTTY) supports it
      local BLUE="\[\033[0;34m\]"
      local LIGHT_BLUE="\[\033[1;34m\]"
      local RED="\[\033[0;31m\]"
      local LIGHT_RED="\[\033[1;31m\]"
      local WHITE="\[\033[1;37m\]"
      local LIGHT_GRAY="\[\033[0;37m\]"

      case $TERM in
      xterm*)
      TITLEBAR='\[\033]0;\u@\h:\w\007\]'
      ;;
      *)
      TITLEBAR=""
      ;;


      export PS1="${TITLEBAR}\
      $LIGHT_BLUE\$(date +%H:%M)-\
      $LIGHT_RED\u@\h:\w$BLUE\
      $WHITE\$$LIGHT_GRAY "
      PS2='> '
      PS4='+ '
      }

      export
      LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:c
      d=40;33;01:or=40;31;01:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.bt
      m=01;32:*.bat=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lz
      h=01;31:*.zip=01;31:*.bz2=01;31:*.rpm=01;31:*.deb=01;31:*.z=01;31:*.Z=01
      ;31:*.gz=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;
      35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;37:*.avi=01;37:*.mov=01;
      37:'
      export LS_OPTIONS=' --color=auto -F -b -T 0'

      Note: I can't say if this is the "RIGHT" way to do it, but it's worked
      for me. Oh - and no, LS_COLORS and LS OPTIONS don't actually work with
      the default LS command provided by BusyBox, but I put them here for
      reference.

      Jon-Mikel

      P.S. I customized most of this from
      http://www.tldp.org/LDP/abs/html/sample-bashrc.html#BASHRC (among other
      places)

      --- In nslu2-general@yahoogroups.com, "trulygilbert" <gil_tsang@...>
      wrote:
      >
      > Just unslung and de-underclocked my NSLU2 (with 2 external USB hard
      > disks) - now it's running Samba, Openssh, ftp, ccxstream, and mt-daapd
      > beautifully. I really appreciate everyone in the community who has
      > made the code and info so accessible and useful.
      >
      > I am reasonably savvy at *nix, but I can't figure out how to change
      > the shell prompt every time I log in: setting PS1 manually will work,
      > but Busybox doesn't read a rc file like .cshrc nor /etc/profile. I
      > have checked info on the busybox website and the NSLU2 forum, but
      > there appears no apparent way to set PS1 automatically everytime I
      log in.
      >
      > Trying to accomplish this without installing bash.
      >
      > Thanks, Gilbert.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.