Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm kind of used to linux. I'm using Busybox from the Busybox Free installer, with Busybox 1.21.0-Stericson. Trying to chance my shell to the Busybox shell using busybox ash gives the following error after every single command:

ash: precmd: not found
echo $PS1
$(precmd)$USER@$HOSTNAME:${PWD: -?} $ 

I tried to go back to the normal shell and find out WHERE precmd is:

which precmd

It just changes the prompt to have "1|" in front of it, without giving me WHERE it is. I found a solution here, but have no idea where to put it. I'm basically trying to do the same as this question (make Busybox shell the default).

share|improve this question
precmd is a function, and as far as I understand ash doesn't support it. – Matthew Read Jan 30 '13 at 17:55
There was a solution here: as I said. I need to find out where to put the code. – Hameer Abbasi Feb 2 '13 at 13:31
up vote 1 down vote accepted

If you are using Connectbot: according to an article at XDA-Developers, this is nothing but a cosmetical error:

Connectbot seems to set shell variable 'PS1' to "$(precmd)$USER@$HOSTNAME:${PWD:-?} $ ".
It means your shell (the busybox's ash applet) will try to use output from 'precmd' as a part of a command prompt. So when 'precmd' was not provided, error messages will be generated wenever a prompt was to be shown.

To fix this, mentioned post says you can use PS1="> " (or simply unset PS1) to work around that error.

share|improve this answer
Looking for further references, I found you already cross-posted this to stackoverflow and got an answer there. It would have been fair to update your question here accordingly, as you obviously got a solution there (the same, it seems) which solved your issue. – Izzy Mar 15 '13 at 16:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.