Thursday, March 3, 2016

4.1 jelly bean - Where is the precmd command in android?


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).



Answer



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.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...