I am trying to setup busybox's ash on an embedded system to support expanding the PS1 prompt statement. I have it currently set as

PS1='\u@\h:\w\$ '

However, all that is displayed is literally \u@\h:\w\$. My environment vars are

  • HOSTNAME=linux
  • USER=root
  • and my pwd is /

So what should be displayed is root@linux:/$. Is there something special I need to do to get the PS1 to expand correctly?

One thing I noticed is my SHELL variable is /bin/sh even though in my /etc/inittab I have the following line


I imagine this is the case because sh and bash are both aliased to ash in the busybox config. However, I have the following options enabled though:

  • bash-compatible extensions
  • Expand prompt string
  • 2
    Did you turn on FEATURE_EDITING (“Command line editing”)? It might help if you posted your Busybox .config. Nov 14, 2012 at 23:25
  • That fixed the problem. For some reason, finding that was harder than expected. I don't know how long I spent looking in the menuconfig and on Google for a solution to this. Thanks!
    – E-rich
    Nov 16, 2012 at 11:38

1 Answer 1


Prompt expansion is always enabled in Busybox's ash or hush if it's been compiled in, there is no runtime way of turning it off. Check that it is really compiled in. In particular, in ash, this requires FEATURE_EDITING (“Command line editing”) to be enabled as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .