[BusyBox 0000647]: ash does not handle '\$' in prompt when prompt expansion is enabled

bugs at busybox.net bugs at busybox.net
Wed Jan 18 09:03:59 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=647 
====================================================================== 
Reported By:                iggarpe
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   647
Category:                   Documentation
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             01-18-2006 00:44 PST
Last Modified:              01-18-2006 01:03 PST
====================================================================== 
Summary:                    ash does not handle '\$' in prompt when prompt
expansion is enabled
Description: 
If you use ash, and CONFIG_ASH_EXPAND_PRMT is enabled, you'll see '$' in
the prompt even if you are root.

I've traced the bug and it seems that prompt expansion turns the default
value of PS1='\w \$ ' into PS1='\w $ ', that is, just removes the '\' in
front of the '$', thus from there on, '$' is printed as a literal in the
prompt. I guess prompt expansion is broken somehow.
====================================================================== 

---------------------------------------------------------------------- 
 vodz - 01-18-06 01:03  
---------------------------------------------------------------------- 
I think, its not bug.
Expanding promt works as eval string.
Example:

1$ bash --version
GNU bash, version 2.05b.0(1)-release (i486-slackware-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.
2$ echo `echo '\w'`
\w
3$ echo `echo '\$'`
$ 
4$ echo `echo '\\$'`
\$

\w is invalid escaping, but \$ - valid. First backslash escaping a dollar
char
and evalute without backslash.

If you using EXPAND_PROMPT feature, then must use double escaping shell
special chars for give with backslash to the fancy promt decoder.

Please close this bug. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-18-06 00:44  iggarpe        New Issue                                    
01-18-06 00:44  iggarpe        Status                   new => assigned     
01-18-06 00:44  iggarpe        Assigned To               => BusyBox         
01-18-06 00:47  iggarpe        Issue Monitored: iggarpe                     
01-18-06 00:47  iggarpe        Issue End Monitor: iggarpe                    
01-18-06 01:03  vodz           Note Added: 0000945                          
======================================================================




More information about the busybox-cvs mailing list